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 SkyBackground
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSKYBACKGROUNDBASE_H_
55 #define _OSGSKYBACKGROUNDBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGWindowDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGBackground.h" // Parent
68 #include "OSGBaseFields.h" // SkyColor type
69 #include "OSGSysFields.h" // SkyAngle type
70 #include "OSGTextureBaseChunkFields.h" // BackTexture type
71 #include "OSGVecFields.h" // TopTexCoord type
72 #include "OSGNodeFields.h" // Beacon type
74 #include "OSGSkyBackgroundFields.h"
81 //! \brief SkyBackground Base Class.
83 class OSG_WINDOW_DLLMAPPING SkyBackgroundBase
: public Background
87 typedef Background Inherited
;
88 typedef Background ParentContainer
;
90 typedef Inherited::TypeObject TypeObject
;
91 typedef TypeObject::InitPhase InitPhase
;
93 OSG_GEN_INTERNALPTR(SkyBackground
);
95 /*========================== PUBLIC =================================*/
101 SkyColorFieldId
= Inherited::NextFieldId
,
102 SkyAngleFieldId
= SkyColorFieldId
+ 1,
103 GroundColorFieldId
= SkyAngleFieldId
+ 1,
104 GroundAngleFieldId
= GroundColorFieldId
+ 1,
105 SphereResFieldId
= GroundAngleFieldId
+ 1,
106 BackTextureFieldId
= SphereResFieldId
+ 1,
107 BottomTextureFieldId
= BackTextureFieldId
+ 1,
108 FrontTextureFieldId
= BottomTextureFieldId
+ 1,
109 LeftTextureFieldId
= FrontTextureFieldId
+ 1,
110 RightTextureFieldId
= LeftTextureFieldId
+ 1,
111 TopTextureFieldId
= RightTextureFieldId
+ 1,
112 BoxInsideFieldId
= TopTextureFieldId
+ 1,
113 TopTexCoordFieldId
= BoxInsideFieldId
+ 1,
114 BottomTexCoordFieldId
= TopTexCoordFieldId
+ 1,
115 RightTexCoordFieldId
= BottomTexCoordFieldId
+ 1,
116 LeftTexCoordFieldId
= RightTexCoordFieldId
+ 1,
117 FrontTexCoordFieldId
= LeftTexCoordFieldId
+ 1,
118 BackTexCoordFieldId
= FrontTexCoordFieldId
+ 1,
119 BeaconFieldId
= BackTexCoordFieldId
+ 1,
120 UseVRMLCubeTextureSemanticsFieldId
= BeaconFieldId
+ 1,
121 NextFieldId
= UseVRMLCubeTextureSemanticsFieldId
+ 1
124 static const OSG::BitVector SkyColorFieldMask
=
125 (TypeTraits
<BitVector
>::One
<< SkyColorFieldId
);
126 static const OSG::BitVector SkyAngleFieldMask
=
127 (TypeTraits
<BitVector
>::One
<< SkyAngleFieldId
);
128 static const OSG::BitVector GroundColorFieldMask
=
129 (TypeTraits
<BitVector
>::One
<< GroundColorFieldId
);
130 static const OSG::BitVector GroundAngleFieldMask
=
131 (TypeTraits
<BitVector
>::One
<< GroundAngleFieldId
);
132 static const OSG::BitVector SphereResFieldMask
=
133 (TypeTraits
<BitVector
>::One
<< SphereResFieldId
);
134 static const OSG::BitVector BackTextureFieldMask
=
135 (TypeTraits
<BitVector
>::One
<< BackTextureFieldId
);
136 static const OSG::BitVector BottomTextureFieldMask
=
137 (TypeTraits
<BitVector
>::One
<< BottomTextureFieldId
);
138 static const OSG::BitVector FrontTextureFieldMask
=
139 (TypeTraits
<BitVector
>::One
<< FrontTextureFieldId
);
140 static const OSG::BitVector LeftTextureFieldMask
=
141 (TypeTraits
<BitVector
>::One
<< LeftTextureFieldId
);
142 static const OSG::BitVector RightTextureFieldMask
=
143 (TypeTraits
<BitVector
>::One
<< RightTextureFieldId
);
144 static const OSG::BitVector TopTextureFieldMask
=
145 (TypeTraits
<BitVector
>::One
<< TopTextureFieldId
);
146 static const OSG::BitVector BoxInsideFieldMask
=
147 (TypeTraits
<BitVector
>::One
<< BoxInsideFieldId
);
148 static const OSG::BitVector TopTexCoordFieldMask
=
149 (TypeTraits
<BitVector
>::One
<< TopTexCoordFieldId
);
150 static const OSG::BitVector BottomTexCoordFieldMask
=
151 (TypeTraits
<BitVector
>::One
<< BottomTexCoordFieldId
);
152 static const OSG::BitVector RightTexCoordFieldMask
=
153 (TypeTraits
<BitVector
>::One
<< RightTexCoordFieldId
);
154 static const OSG::BitVector LeftTexCoordFieldMask
=
155 (TypeTraits
<BitVector
>::One
<< LeftTexCoordFieldId
);
156 static const OSG::BitVector FrontTexCoordFieldMask
=
157 (TypeTraits
<BitVector
>::One
<< FrontTexCoordFieldId
);
158 static const OSG::BitVector BackTexCoordFieldMask
=
159 (TypeTraits
<BitVector
>::One
<< BackTexCoordFieldId
);
160 static const OSG::BitVector BeaconFieldMask
=
161 (TypeTraits
<BitVector
>::One
<< BeaconFieldId
);
162 static const OSG::BitVector UseVRMLCubeTextureSemanticsFieldMask
=
163 (TypeTraits
<BitVector
>::One
<< UseVRMLCubeTextureSemanticsFieldId
);
164 static const OSG::BitVector NextFieldMask
=
165 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
167 typedef MFColor4f MFSkyColorType
;
168 typedef MFReal32 MFSkyAngleType
;
169 typedef MFColor4f MFGroundColorType
;
170 typedef MFReal32 MFGroundAngleType
;
171 typedef SFUInt32 SFSphereResType
;
172 typedef SFUnrecTextureBaseChunkPtr SFBackTextureType
;
173 typedef SFUnrecTextureBaseChunkPtr SFBottomTextureType
;
174 typedef SFUnrecTextureBaseChunkPtr SFFrontTextureType
;
175 typedef SFUnrecTextureBaseChunkPtr SFLeftTextureType
;
176 typedef SFUnrecTextureBaseChunkPtr SFRightTextureType
;
177 typedef SFUnrecTextureBaseChunkPtr SFTopTextureType
;
178 typedef SFBool SFBoxInsideType
;
179 typedef MFVec3f MFTopTexCoordType
;
180 typedef MFVec3f MFBottomTexCoordType
;
181 typedef MFVec3f MFRightTexCoordType
;
182 typedef MFVec3f MFLeftTexCoordType
;
183 typedef MFVec3f MFFrontTexCoordType
;
184 typedef MFVec3f MFBackTexCoordType
;
185 typedef SFWeakNodePtr SFBeaconType
;
186 typedef SFBool SFUseVRMLCubeTextureSemanticsType
;
188 /*---------------------------------------------------------------------*/
189 /*! \name Class Get */
192 static FieldContainerType
&getClassType (void);
193 static UInt32
getClassTypeId (void);
194 static UInt16
getClassGroupId(void);
197 /*---------------------------------------------------------------------*/
198 /*! \name FieldContainer Get */
201 virtual FieldContainerType
&getType (void);
202 virtual const FieldContainerType
&getType (void) const;
204 virtual UInt32
getContainerSize(void) const;
207 /*---------------------------------------------------------------------*/
208 /*! \name Field Get */
212 MFColor4f
*editMFSkyColor (void);
213 const MFColor4f
*getMFSkyColor (void) const;
215 MFReal32
*editMFSkyAngle (void);
216 const MFReal32
*getMFSkyAngle (void) const;
218 MFColor4f
*editMFGroundColor (void);
219 const MFColor4f
*getMFGroundColor (void) const;
221 MFReal32
*editMFGroundAngle (void);
222 const MFReal32
*getMFGroundAngle (void) const;
224 SFUInt32
*editSFSphereRes (void);
225 const SFUInt32
*getSFSphereRes (void) const;
226 const SFUnrecTextureBaseChunkPtr
*getSFBackTexture (void) const;
227 SFUnrecTextureBaseChunkPtr
*editSFBackTexture (void);
228 const SFUnrecTextureBaseChunkPtr
*getSFBottomTexture (void) const;
229 SFUnrecTextureBaseChunkPtr
*editSFBottomTexture (void);
230 const SFUnrecTextureBaseChunkPtr
*getSFFrontTexture (void) const;
231 SFUnrecTextureBaseChunkPtr
*editSFFrontTexture (void);
232 const SFUnrecTextureBaseChunkPtr
*getSFLeftTexture (void) const;
233 SFUnrecTextureBaseChunkPtr
*editSFLeftTexture (void);
234 const SFUnrecTextureBaseChunkPtr
*getSFRightTexture (void) const;
235 SFUnrecTextureBaseChunkPtr
*editSFRightTexture (void);
236 const SFUnrecTextureBaseChunkPtr
*getSFTopTexture (void) const;
237 SFUnrecTextureBaseChunkPtr
*editSFTopTexture (void);
239 SFBool
*editSFBoxInside (void);
240 const SFBool
*getSFBoxInside (void) const;
242 MFVec3f
*editMFTopTexCoord (void);
243 const MFVec3f
*getMFTopTexCoord (void) const;
245 MFVec3f
*editMFBottomTexCoord (void);
246 const MFVec3f
*getMFBottomTexCoord (void) const;
248 MFVec3f
*editMFRightTexCoord (void);
249 const MFVec3f
*getMFRightTexCoord (void) const;
251 MFVec3f
*editMFLeftTexCoord (void);
252 const MFVec3f
*getMFLeftTexCoord (void) const;
254 MFVec3f
*editMFFrontTexCoord (void);
255 const MFVec3f
*getMFFrontTexCoord (void) const;
257 MFVec3f
*editMFBackTexCoord (void);
258 const MFVec3f
*getMFBackTexCoord (void) const;
259 const SFWeakNodePtr
*getSFBeacon (void) const;
260 SFWeakNodePtr
*editSFBeacon (void);
262 SFBool
*editSFUseVRMLCubeTextureSemantics(void);
263 const SFBool
*getSFUseVRMLCubeTextureSemantics (void) const;
266 MFColor4f ::reference
editSkyColor (const UInt32 index
);
267 const Color4f
&getSkyColor (const UInt32 index
) const;
269 MFReal32 ::reference
editSkyAngle (const UInt32 index
);
270 Real32
getSkyAngle (const UInt32 index
) const;
272 MFColor4f ::reference
editGroundColor (const UInt32 index
);
273 const Color4f
&getGroundColor (const UInt32 index
) const;
275 MFReal32 ::reference
editGroundAngle (const UInt32 index
);
276 Real32
getGroundAngle (const UInt32 index
) const;
278 UInt32
&editSphereRes (void);
279 UInt32
getSphereRes (void) const;
281 TextureBaseChunk
* getBackTexture (void) const;
283 TextureBaseChunk
* getBottomTexture (void) const;
285 TextureBaseChunk
* getFrontTexture (void) const;
287 TextureBaseChunk
* getLeftTexture (void) const;
289 TextureBaseChunk
* getRightTexture (void) const;
291 TextureBaseChunk
* getTopTexture (void) const;
293 bool &editBoxInside (void);
294 bool getBoxInside (void) const;
296 MFVec3f ::reference
editTopTexCoord (const UInt32 index
);
297 const Vec3f
&getTopTexCoord (const UInt32 index
) const;
299 MFVec3f ::reference
editBottomTexCoord (const UInt32 index
);
300 const Vec3f
&getBottomTexCoord (const UInt32 index
) const;
302 MFVec3f ::reference
editRightTexCoord (const UInt32 index
);
303 const Vec3f
&getRightTexCoord (const UInt32 index
) const;
305 MFVec3f ::reference
editLeftTexCoord (const UInt32 index
);
306 const Vec3f
&getLeftTexCoord (const UInt32 index
) const;
308 MFVec3f ::reference
editFrontTexCoord (const UInt32 index
);
309 const Vec3f
&getFrontTexCoord (const UInt32 index
) const;
311 MFVec3f ::reference
editBackTexCoord (const UInt32 index
);
312 const Vec3f
&getBackTexCoord (const UInt32 index
) const;
314 Node
* getBeacon (void) const;
316 bool &editUseVRMLCubeTextureSemantics(void);
317 bool getUseVRMLCubeTextureSemantics (void) const;
320 /*---------------------------------------------------------------------*/
321 /*! \name Field Set */
324 void setSphereRes (const UInt32 value
);
325 void setBackTexture (TextureBaseChunk
* const value
);
326 void setBottomTexture (TextureBaseChunk
* const value
);
327 void setFrontTexture (TextureBaseChunk
* const value
);
328 void setLeftTexture (TextureBaseChunk
* const value
);
329 void setRightTexture (TextureBaseChunk
* const value
);
330 void setTopTexture (TextureBaseChunk
* const value
);
331 void setBoxInside (const bool value
);
332 void setBeacon (Node
* const value
);
333 void setUseVRMLCubeTextureSemantics(const bool value
);
336 /*---------------------------------------------------------------------*/
337 /*! \name Ptr Field Set */
341 /*---------------------------------------------------------------------*/
342 /*! \name Ptr MField Set */
346 /*---------------------------------------------------------------------*/
347 /*! \name Binary Access */
350 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
351 virtual void copyToBin (BinaryDataHandler
&pMem
,
352 ConstFieldMaskArg whichField
);
353 virtual void copyFromBin(BinaryDataHandler
&pMem
,
354 ConstFieldMaskArg whichField
);
358 /*---------------------------------------------------------------------*/
359 /*! \name Construction */
362 static SkyBackgroundTransitPtr
create (void);
363 static SkyBackground
*createEmpty (void);
365 static SkyBackgroundTransitPtr
createLocal (
366 BitVector bFlags
= FCLocal::All
);
368 static SkyBackground
*createEmptyLocal(
369 BitVector bFlags
= FCLocal::All
);
371 static SkyBackgroundTransitPtr
createDependent (BitVector bFlags
);
374 /*---------------------------------------------------------------------*/
378 virtual FieldContainerTransitPtr
shallowCopy (void) const;
379 virtual FieldContainerTransitPtr
shallowCopyLocal(
380 BitVector bFlags
= FCLocal::All
) const;
381 virtual FieldContainerTransitPtr
shallowCopyDependent(
382 BitVector bFlags
) const;
385 /*========================= PROTECTED ===============================*/
389 static TypeObject _type
;
391 static void classDescInserter(TypeObject
&oType
);
392 static const Char8
*getClassname (void );
394 /*---------------------------------------------------------------------*/
398 MFColor4f _mfSkyColor
;
399 MFReal32 _mfSkyAngle
;
400 MFColor4f _mfGroundColor
;
401 MFReal32 _mfGroundAngle
;
402 SFUInt32 _sfSphereRes
;
403 SFUnrecTextureBaseChunkPtr _sfBackTexture
;
404 SFUnrecTextureBaseChunkPtr _sfBottomTexture
;
405 SFUnrecTextureBaseChunkPtr _sfFrontTexture
;
406 SFUnrecTextureBaseChunkPtr _sfLeftTexture
;
407 SFUnrecTextureBaseChunkPtr _sfRightTexture
;
408 SFUnrecTextureBaseChunkPtr _sfTopTexture
;
410 MFVec3f _mfTopTexCoord
;
411 MFVec3f _mfBottomTexCoord
;
412 MFVec3f _mfRightTexCoord
;
413 MFVec3f _mfLeftTexCoord
;
414 MFVec3f _mfFrontTexCoord
;
415 MFVec3f _mfBackTexCoord
;
416 SFWeakNodePtr _sfBeacon
;
417 SFBool _sfUseVRMLCubeTextureSemantics
;
420 /*---------------------------------------------------------------------*/
421 /*! \name Constructors */
424 SkyBackgroundBase(void);
425 SkyBackgroundBase(const SkyBackgroundBase
&source
);
428 /*---------------------------------------------------------------------*/
429 /*! \name Destructors */
432 virtual ~SkyBackgroundBase(void);
435 /*---------------------------------------------------------------------*/
436 /*! \name onCreate */
439 void onCreate(const SkyBackground
*source
= NULL
);
442 /*---------------------------------------------------------------------*/
443 /*! \name Generic Field Access */
446 GetFieldHandlePtr
getHandleSkyColor (void) const;
447 EditFieldHandlePtr
editHandleSkyColor (void);
448 GetFieldHandlePtr
getHandleSkyAngle (void) const;
449 EditFieldHandlePtr
editHandleSkyAngle (void);
450 GetFieldHandlePtr
getHandleGroundColor (void) const;
451 EditFieldHandlePtr
editHandleGroundColor (void);
452 GetFieldHandlePtr
getHandleGroundAngle (void) const;
453 EditFieldHandlePtr
editHandleGroundAngle (void);
454 GetFieldHandlePtr
getHandleSphereRes (void) const;
455 EditFieldHandlePtr
editHandleSphereRes (void);
456 GetFieldHandlePtr
getHandleBackTexture (void) const;
457 EditFieldHandlePtr
editHandleBackTexture (void);
458 GetFieldHandlePtr
getHandleBottomTexture (void) const;
459 EditFieldHandlePtr
editHandleBottomTexture (void);
460 GetFieldHandlePtr
getHandleFrontTexture (void) const;
461 EditFieldHandlePtr
editHandleFrontTexture (void);
462 GetFieldHandlePtr
getHandleLeftTexture (void) const;
463 EditFieldHandlePtr
editHandleLeftTexture (void);
464 GetFieldHandlePtr
getHandleRightTexture (void) const;
465 EditFieldHandlePtr
editHandleRightTexture (void);
466 GetFieldHandlePtr
getHandleTopTexture (void) const;
467 EditFieldHandlePtr
editHandleTopTexture (void);
468 GetFieldHandlePtr
getHandleBoxInside (void) const;
469 EditFieldHandlePtr
editHandleBoxInside (void);
470 GetFieldHandlePtr
getHandleTopTexCoord (void) const;
471 EditFieldHandlePtr
editHandleTopTexCoord (void);
472 GetFieldHandlePtr
getHandleBottomTexCoord (void) const;
473 EditFieldHandlePtr
editHandleBottomTexCoord (void);
474 GetFieldHandlePtr
getHandleRightTexCoord (void) const;
475 EditFieldHandlePtr
editHandleRightTexCoord (void);
476 GetFieldHandlePtr
getHandleLeftTexCoord (void) const;
477 EditFieldHandlePtr
editHandleLeftTexCoord (void);
478 GetFieldHandlePtr
getHandleFrontTexCoord (void) const;
479 EditFieldHandlePtr
editHandleFrontTexCoord (void);
480 GetFieldHandlePtr
getHandleBackTexCoord (void) const;
481 EditFieldHandlePtr
editHandleBackTexCoord (void);
482 GetFieldHandlePtr
getHandleBeacon (void) const;
483 EditFieldHandlePtr
editHandleBeacon (void);
484 GetFieldHandlePtr
getHandleUseVRMLCubeTextureSemantics (void) const;
485 EditFieldHandlePtr
editHandleUseVRMLCubeTextureSemantics(void);
488 /*---------------------------------------------------------------------*/
492 #ifdef OSG_MT_CPTR_ASPECT
493 virtual void execSyncV( FieldContainer
&oFrom
,
494 ConstFieldMaskArg whichField
,
495 AspectOffsetStore
&oOffsets
,
496 ConstFieldMaskArg syncMode
,
497 const UInt32 uiSyncInfo
);
499 void execSync ( SkyBackgroundBase
*pFrom
,
500 ConstFieldMaskArg whichField
,
501 AspectOffsetStore
&oOffsets
,
502 ConstFieldMaskArg syncMode
,
503 const UInt32 uiSyncInfo
);
507 /*---------------------------------------------------------------------*/
512 /*---------------------------------------------------------------------*/
513 /*! \name Aspect Create */
516 #ifdef OSG_MT_CPTR_ASPECT
517 virtual FieldContainer
*createAspectCopy(
518 const FieldContainer
*pRefAspect
) const;
522 /*---------------------------------------------------------------------*/
526 /*---------------------------------------------------------------------*/
530 virtual void resolveLinks(void);
533 /*========================== PRIVATE ================================*/
536 /*---------------------------------------------------------------------*/
538 // prohibit default functions (move to 'public' if you need one)
539 void operator =(const SkyBackgroundBase
&source
);
542 typedef SkyBackgroundBase
*SkyBackgroundBaseP
;
546 #endif /* _OSGSKYBACKGROUNDBASE_H_ */