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 CubeMapGenerator
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGCUBEMAPGENERATORBASE_H_
55 #define _OSGCUBEMAPGENERATORBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGGroupDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGDynamicStateGenerator.h" // Parent
68 #include "OSGNodeFields.h" // Root type
69 #include "OSGTextureObjChunkFields.h" // Texture type
70 #include "OSGVecFields.h" // TextureSize type
71 #include "OSGBaseFields.h" // TextureFormat type
72 #include "OSGSysFields.h" // OriginMode type
73 #include "OSGBackgroundFields.h" // Background type
74 #include "OSGCameraFields.h" // Camera type
76 #include "OSGCubeMapGeneratorFields.h"
81 class CubeMapGenerator
;
83 //! \brief CubeMapGenerator Base Class.
85 class OSG_GROUP_DLLMAPPING CubeMapGeneratorBase
: public DynamicStateGenerator
89 typedef DynamicStateGenerator Inherited
;
90 typedef DynamicStateGenerator ParentContainer
;
92 typedef Inherited::TypeObject TypeObject
;
93 typedef TypeObject::InitPhase InitPhase
;
95 OSG_GEN_INTERNALPTR(CubeMapGenerator
);
97 /*========================== PUBLIC =================================*/
103 RootFieldId
= Inherited::NextFieldId
,
104 ExcludeFieldId
= RootFieldId
+ 1,
105 TextureFieldId
= ExcludeFieldId
+ 1,
106 TextureSizeFieldId
= TextureFieldId
+ 1,
107 TextureFormatFieldId
= TextureSizeFieldId
+ 1,
108 BeaconFieldId
= TextureFormatFieldId
+ 1,
109 OriginFieldId
= BeaconFieldId
+ 1,
110 OriginModeFieldId
= OriginFieldId
+ 1,
111 TexUnitFieldId
= OriginModeFieldId
+ 1,
112 SetupModeFieldId
= TexUnitFieldId
+ 1,
113 BackgroundFieldId
= SetupModeFieldId
+ 1,
114 CameraFieldId
= BackgroundFieldId
+ 1,
115 NextFieldId
= CameraFieldId
+ 1
118 static const OSG::BitVector RootFieldMask
=
119 (TypeTraits
<BitVector
>::One
<< RootFieldId
);
120 static const OSG::BitVector ExcludeFieldMask
=
121 (TypeTraits
<BitVector
>::One
<< ExcludeFieldId
);
122 static const OSG::BitVector TextureFieldMask
=
123 (TypeTraits
<BitVector
>::One
<< TextureFieldId
);
124 static const OSG::BitVector TextureSizeFieldMask
=
125 (TypeTraits
<BitVector
>::One
<< TextureSizeFieldId
);
126 static const OSG::BitVector TextureFormatFieldMask
=
127 (TypeTraits
<BitVector
>::One
<< TextureFormatFieldId
);
128 static const OSG::BitVector BeaconFieldMask
=
129 (TypeTraits
<BitVector
>::One
<< BeaconFieldId
);
130 static const OSG::BitVector OriginFieldMask
=
131 (TypeTraits
<BitVector
>::One
<< OriginFieldId
);
132 static const OSG::BitVector OriginModeFieldMask
=
133 (TypeTraits
<BitVector
>::One
<< OriginModeFieldId
);
134 static const OSG::BitVector TexUnitFieldMask
=
135 (TypeTraits
<BitVector
>::One
<< TexUnitFieldId
);
136 static const OSG::BitVector SetupModeFieldMask
=
137 (TypeTraits
<BitVector
>::One
<< SetupModeFieldId
);
138 static const OSG::BitVector BackgroundFieldMask
=
139 (TypeTraits
<BitVector
>::One
<< BackgroundFieldId
);
140 static const OSG::BitVector CameraFieldMask
=
141 (TypeTraits
<BitVector
>::One
<< CameraFieldId
);
142 static const OSG::BitVector NextFieldMask
=
143 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
145 typedef SFUnrecNodePtr SFRootType
;
146 typedef MFUnrecNodePtr MFExcludeType
;
147 typedef SFUnrecTextureObjChunkPtr SFTextureType
;
148 typedef SFVec2s SFTextureSizeType
;
149 typedef SFGLenum SFTextureFormatType
;
150 typedef SFWeakNodePtr SFBeaconType
;
151 typedef SFPnt3f SFOriginType
;
152 typedef SFUInt32 SFOriginModeType
;
153 typedef SFUInt32 SFTexUnitType
;
154 typedef SFUInt32 SFSetupModeType
;
155 typedef SFUnrecBackgroundPtr SFBackgroundType
;
156 typedef SFUnrecCameraPtr SFCameraType
;
158 /*---------------------------------------------------------------------*/
159 /*! \name Class Get */
162 static FieldContainerType
&getClassType (void);
163 static UInt32
getClassTypeId (void);
164 static UInt16
getClassGroupId(void);
167 /*---------------------------------------------------------------------*/
168 /*! \name FieldContainer Get */
171 virtual FieldContainerType
&getType (void);
172 virtual const FieldContainerType
&getType (void) const;
174 virtual UInt32
getContainerSize(void) const;
177 /*---------------------------------------------------------------------*/
178 /*! \name Field Get */
181 const SFUnrecNodePtr
*getSFRoot (void) const;
182 SFUnrecNodePtr
*editSFRoot (void);
183 const MFUnrecNodePtr
*getMFExclude (void) const;
184 MFUnrecNodePtr
*editMFExclude (void);
185 const SFUnrecTextureObjChunkPtr
*getSFTexture (void) const;
186 SFUnrecTextureObjChunkPtr
*editSFTexture (void);
188 SFVec2s
*editSFTextureSize (void);
189 const SFVec2s
*getSFTextureSize (void) const;
191 SFGLenum
*editSFTextureFormat (void);
192 const SFGLenum
*getSFTextureFormat (void) const;
193 const SFWeakNodePtr
*getSFBeacon (void) const;
194 SFWeakNodePtr
*editSFBeacon (void);
196 SFPnt3f
*editSFOrigin (void);
197 const SFPnt3f
*getSFOrigin (void) const;
199 SFUInt32
*editSFOriginMode (void);
200 const SFUInt32
*getSFOriginMode (void) const;
202 SFUInt32
*editSFTexUnit (void);
203 const SFUInt32
*getSFTexUnit (void) const;
205 SFUInt32
*editSFSetupMode (void);
206 const SFUInt32
*getSFSetupMode (void) const;
207 const SFUnrecBackgroundPtr
*getSFBackground (void) const;
208 SFUnrecBackgroundPtr
*editSFBackground (void);
209 const SFUnrecCameraPtr
*getSFCamera (void) const;
210 SFUnrecCameraPtr
*editSFCamera (void);
213 Node
* getRoot (void) const;
215 Node
* getExclude (const UInt32 index
) const;
217 TextureObjChunk
* getTexture (void) const;
219 Vec2s
&editTextureSize (void);
220 const Vec2s
&getTextureSize (void) const;
222 GLenum
&editTextureFormat (void);
223 const GLenum
&getTextureFormat (void) const;
225 Node
* getBeacon (void) const;
227 Pnt3f
&editOrigin (void);
228 const Pnt3f
&getOrigin (void) const;
230 UInt32
&editOriginMode (void);
231 UInt32
getOriginMode (void) const;
233 UInt32
&editTexUnit (void);
234 UInt32
getTexUnit (void) const;
236 UInt32
&editSetupMode (void);
237 UInt32
getSetupMode (void) const;
239 Background
* getBackground (void) const;
241 Camera
* getCamera (void) const;
244 /*---------------------------------------------------------------------*/
245 /*! \name Field Set */
248 void setRoot (Node
* const value
);
249 void setTexture (TextureObjChunk
* const value
);
250 void setTextureSize (const Vec2s
&value
);
251 void setTextureFormat (const GLenum
&value
);
252 void setBeacon (Node
* const value
);
253 void setOrigin (const Pnt3f
&value
);
254 void setOriginMode (const UInt32 value
);
255 void setTexUnit (const UInt32 value
);
256 void setSetupMode (const UInt32 value
);
257 void setBackground (Background
* const value
);
258 void setCamera (Camera
* const value
);
261 /*---------------------------------------------------------------------*/
262 /*! \name Ptr Field Set */
266 /*---------------------------------------------------------------------*/
267 /*! \name Ptr MField Set */
270 void pushToExclude (Node
* const value
);
271 void assignExclude (const MFUnrecNodePtr
&value
);
272 void removeFromExclude (UInt32 uiIndex
);
273 void removeObjFromExclude(Node
* const value
);
274 void clearExclude (void );
277 /*---------------------------------------------------------------------*/
278 /*! \name Binary Access */
281 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
282 virtual void copyToBin (BinaryDataHandler
&pMem
,
283 ConstFieldMaskArg whichField
);
284 virtual void copyFromBin(BinaryDataHandler
&pMem
,
285 ConstFieldMaskArg whichField
);
289 /*---------------------------------------------------------------------*/
290 /*! \name Construction */
293 static CubeMapGeneratorTransitPtr
create (void);
294 static CubeMapGenerator
*createEmpty (void);
296 static CubeMapGeneratorTransitPtr
createLocal (
297 BitVector bFlags
= FCLocal::All
);
299 static CubeMapGenerator
*createEmptyLocal(
300 BitVector bFlags
= FCLocal::All
);
302 static CubeMapGeneratorTransitPtr
createDependent (BitVector bFlags
);
305 /*---------------------------------------------------------------------*/
309 virtual FieldContainerTransitPtr
shallowCopy (void) const;
310 virtual FieldContainerTransitPtr
shallowCopyLocal(
311 BitVector bFlags
= FCLocal::All
) const;
312 virtual FieldContainerTransitPtr
shallowCopyDependent(
313 BitVector bFlags
) const;
316 /*========================= PROTECTED ===============================*/
320 static TypeObject _type
;
322 static void classDescInserter(TypeObject
&oType
);
323 static const Char8
*getClassname (void );
325 /*---------------------------------------------------------------------*/
329 SFUnrecNodePtr _sfRoot
;
330 MFUnrecNodePtr _mfExclude
;
331 SFUnrecTextureObjChunkPtr _sfTexture
;
332 SFVec2s _sfTextureSize
;
333 SFGLenum _sfTextureFormat
;
334 SFWeakNodePtr _sfBeacon
;
336 SFUInt32 _sfOriginMode
;
338 SFUInt32 _sfSetupMode
;
339 SFUnrecBackgroundPtr _sfBackground
;
340 SFUnrecCameraPtr _sfCamera
;
343 /*---------------------------------------------------------------------*/
344 /*! \name Constructors */
347 CubeMapGeneratorBase(void);
348 CubeMapGeneratorBase(const CubeMapGeneratorBase
&source
);
351 /*---------------------------------------------------------------------*/
352 /*! \name Destructors */
355 virtual ~CubeMapGeneratorBase(void);
358 /*---------------------------------------------------------------------*/
359 /*! \name onCreate */
362 void onCreate(const CubeMapGenerator
*source
= NULL
);
365 /*---------------------------------------------------------------------*/
366 /*! \name Generic Field Access */
369 GetFieldHandlePtr
getHandleRoot (void) const;
370 EditFieldHandlePtr
editHandleRoot (void);
371 GetFieldHandlePtr
getHandleExclude (void) const;
372 EditFieldHandlePtr
editHandleExclude (void);
373 GetFieldHandlePtr
getHandleTexture (void) const;
374 EditFieldHandlePtr
editHandleTexture (void);
375 GetFieldHandlePtr
getHandleTextureSize (void) const;
376 EditFieldHandlePtr
editHandleTextureSize (void);
377 GetFieldHandlePtr
getHandleTextureFormat (void) const;
378 EditFieldHandlePtr
editHandleTextureFormat (void);
379 GetFieldHandlePtr
getHandleBeacon (void) const;
380 EditFieldHandlePtr
editHandleBeacon (void);
381 GetFieldHandlePtr
getHandleOrigin (void) const;
382 EditFieldHandlePtr
editHandleOrigin (void);
383 GetFieldHandlePtr
getHandleOriginMode (void) const;
384 EditFieldHandlePtr
editHandleOriginMode (void);
385 GetFieldHandlePtr
getHandleTexUnit (void) const;
386 EditFieldHandlePtr
editHandleTexUnit (void);
387 GetFieldHandlePtr
getHandleSetupMode (void) const;
388 EditFieldHandlePtr
editHandleSetupMode (void);
389 GetFieldHandlePtr
getHandleBackground (void) const;
390 EditFieldHandlePtr
editHandleBackground (void);
391 GetFieldHandlePtr
getHandleCamera (void) const;
392 EditFieldHandlePtr
editHandleCamera (void);
395 /*---------------------------------------------------------------------*/
399 #ifdef OSG_MT_CPTR_ASPECT
400 virtual void execSyncV( FieldContainer
&oFrom
,
401 ConstFieldMaskArg whichField
,
402 AspectOffsetStore
&oOffsets
,
403 ConstFieldMaskArg syncMode
,
404 const UInt32 uiSyncInfo
);
406 void execSync ( CubeMapGeneratorBase
*pFrom
,
407 ConstFieldMaskArg whichField
,
408 AspectOffsetStore
&oOffsets
,
409 ConstFieldMaskArg syncMode
,
410 const UInt32 uiSyncInfo
);
414 /*---------------------------------------------------------------------*/
419 /*---------------------------------------------------------------------*/
420 /*! \name Aspect Create */
423 #ifdef OSG_MT_CPTR_ASPECT
424 virtual FieldContainer
*createAspectCopy(
425 const FieldContainer
*pRefAspect
) const;
429 /*---------------------------------------------------------------------*/
433 /*---------------------------------------------------------------------*/
437 virtual void resolveLinks(void);
440 /*========================== PRIVATE ================================*/
443 /*---------------------------------------------------------------------*/
445 // prohibit default functions (move to 'public' if you need one)
446 void operator =(const CubeMapGeneratorBase
&source
);
449 typedef CubeMapGeneratorBase
*CubeMapGeneratorBaseP
;
451 typedef CoredNodeRefPtr
<CubeMapGenerator
> CubeMapGeneratorNodeRefPtr
;
452 typedef CoredNodeMTRefPtr
<CubeMapGenerator
> CubeMapGeneratorNodeMTRefPtr
;
456 #endif /* _OSGCUBEMAPGENERATORBASE_H_ */