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 TextureBackground
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGTEXTUREBACKGROUNDBASE_H_
55 #define _OSGTEXTUREBACKGROUNDBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGWindowDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGBackground.h" // Parent
68 #include "OSGBaseFields.h" // Color type
69 #include "OSGTextureBaseChunkFields.h" // Texture type
70 #include "OSGVecFields.h" // TexCoords type
71 #include "OSGSysFields.h" // RadialDistortion type
73 #include "OSGTextureBackgroundFields.h"
78 class TextureBackground
;
80 //! \brief TextureBackground Base Class.
82 class OSG_WINDOW_DLLMAPPING TextureBackgroundBase
: public Background
86 typedef Background Inherited
;
87 typedef Background ParentContainer
;
89 typedef Inherited::TypeObject TypeObject
;
90 typedef TypeObject::InitPhase InitPhase
;
92 OSG_GEN_INTERNALPTR(TextureBackground
);
94 /*========================== PUBLIC =================================*/
100 ColorFieldId
= Inherited::NextFieldId
,
101 TextureFieldId
= ColorFieldId
+ 1,
102 TexCoordsFieldId
= TextureFieldId
+ 1,
103 RadialDistortionFieldId
= TexCoordsFieldId
+ 1,
104 CenterOfDistortionFieldId
= RadialDistortionFieldId
+ 1,
105 HorFieldId
= CenterOfDistortionFieldId
+ 1,
106 VertFieldId
= HorFieldId
+ 1,
107 NextFieldId
= VertFieldId
+ 1
110 static const OSG::BitVector ColorFieldMask
=
111 (TypeTraits
<BitVector
>::One
<< ColorFieldId
);
112 static const OSG::BitVector TextureFieldMask
=
113 (TypeTraits
<BitVector
>::One
<< TextureFieldId
);
114 static const OSG::BitVector TexCoordsFieldMask
=
115 (TypeTraits
<BitVector
>::One
<< TexCoordsFieldId
);
116 static const OSG::BitVector RadialDistortionFieldMask
=
117 (TypeTraits
<BitVector
>::One
<< RadialDistortionFieldId
);
118 static const OSG::BitVector CenterOfDistortionFieldMask
=
119 (TypeTraits
<BitVector
>::One
<< CenterOfDistortionFieldId
);
120 static const OSG::BitVector HorFieldMask
=
121 (TypeTraits
<BitVector
>::One
<< HorFieldId
);
122 static const OSG::BitVector VertFieldMask
=
123 (TypeTraits
<BitVector
>::One
<< VertFieldId
);
124 static const OSG::BitVector NextFieldMask
=
125 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
127 typedef SFColor4f SFColorType
;
128 typedef SFUnrecTextureBaseChunkPtr SFTextureType
;
129 typedef MFPnt2f MFTexCoordsType
;
130 typedef SFReal32 SFRadialDistortionType
;
131 typedef SFVec2f SFCenterOfDistortionType
;
132 typedef SFUInt16 SFHorType
;
133 typedef SFUInt16 SFVertType
;
135 /*---------------------------------------------------------------------*/
136 /*! \name Class Get */
139 static FieldContainerType
&getClassType (void);
140 static UInt32
getClassTypeId (void);
141 static UInt16
getClassGroupId(void);
144 /*---------------------------------------------------------------------*/
145 /*! \name FieldContainer Get */
148 virtual FieldContainerType
&getType (void);
149 virtual const FieldContainerType
&getType (void) const;
151 virtual UInt32
getContainerSize(void) const;
154 /*---------------------------------------------------------------------*/
155 /*! \name Field Get */
159 SFColor4f
*editSFColor (void);
160 const SFColor4f
*getSFColor (void) const;
161 const SFUnrecTextureBaseChunkPtr
*getSFTexture (void) const;
162 SFUnrecTextureBaseChunkPtr
*editSFTexture (void);
164 MFPnt2f
*editMFTexCoords (void);
165 const MFPnt2f
*getMFTexCoords (void) const;
167 SFReal32
*editSFRadialDistortion(void);
168 const SFReal32
*getSFRadialDistortion (void) const;
170 SFVec2f
*editSFCenterOfDistortion(void);
171 const SFVec2f
*getSFCenterOfDistortion (void) const;
173 SFUInt16
*editSFHor (void);
174 const SFUInt16
*getSFHor (void) const;
176 SFUInt16
*editSFVert (void);
177 const SFUInt16
*getSFVert (void) const;
180 Color4f
&editColor (void);
181 const Color4f
&getColor (void) const;
183 TextureBaseChunk
* getTexture (void) const;
185 MFPnt2f ::reference
editTexCoords (const UInt32 index
);
186 const Pnt2f
&getTexCoords (const UInt32 index
) const;
188 Real32
&editRadialDistortion(void);
189 Real32
getRadialDistortion (void) const;
191 Vec2f
&editCenterOfDistortion(void);
192 const Vec2f
&getCenterOfDistortion (void) const;
194 UInt16
&editHor (void);
195 UInt16
getHor (void) const;
197 UInt16
&editVert (void);
198 UInt16
getVert (void) const;
201 /*---------------------------------------------------------------------*/
202 /*! \name Field Set */
205 void setColor (const Color4f
&value
);
206 void setTexture (TextureBaseChunk
* const value
);
207 void setRadialDistortion(const Real32 value
);
208 void setCenterOfDistortion(const Vec2f
&value
);
209 void setHor (const UInt16 value
);
210 void setVert (const UInt16 value
);
213 /*---------------------------------------------------------------------*/
214 /*! \name Ptr Field Set */
218 /*---------------------------------------------------------------------*/
219 /*! \name Ptr MField Set */
223 /*---------------------------------------------------------------------*/
224 /*! \name Binary Access */
227 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
228 virtual void copyToBin (BinaryDataHandler
&pMem
,
229 ConstFieldMaskArg whichField
);
230 virtual void copyFromBin(BinaryDataHandler
&pMem
,
231 ConstFieldMaskArg whichField
);
235 /*---------------------------------------------------------------------*/
236 /*! \name Construction */
239 static TextureBackgroundTransitPtr
create (void);
240 static TextureBackground
*createEmpty (void);
242 static TextureBackgroundTransitPtr
createLocal (
243 BitVector bFlags
= FCLocal::All
);
245 static TextureBackground
*createEmptyLocal(
246 BitVector bFlags
= FCLocal::All
);
248 static TextureBackgroundTransitPtr
createDependent (BitVector bFlags
);
251 /*---------------------------------------------------------------------*/
255 virtual FieldContainerTransitPtr
shallowCopy (void) const;
256 virtual FieldContainerTransitPtr
shallowCopyLocal(
257 BitVector bFlags
= FCLocal::All
) const;
258 virtual FieldContainerTransitPtr
shallowCopyDependent(
259 BitVector bFlags
) const;
262 /*========================= PROTECTED ===============================*/
266 static TypeObject _type
;
268 static void classDescInserter(TypeObject
&oType
);
269 static const Char8
*getClassname (void );
271 /*---------------------------------------------------------------------*/
276 SFUnrecTextureBaseChunkPtr _sfTexture
;
277 MFPnt2f _mfTexCoords
;
278 SFReal32 _sfRadialDistortion
;
279 SFVec2f _sfCenterOfDistortion
;
284 /*---------------------------------------------------------------------*/
285 /*! \name Constructors */
288 TextureBackgroundBase(void);
289 TextureBackgroundBase(const TextureBackgroundBase
&source
);
292 /*---------------------------------------------------------------------*/
293 /*! \name Destructors */
296 virtual ~TextureBackgroundBase(void);
299 /*---------------------------------------------------------------------*/
300 /*! \name onCreate */
303 void onCreate(const TextureBackground
*source
= NULL
);
306 /*---------------------------------------------------------------------*/
307 /*! \name Generic Field Access */
310 GetFieldHandlePtr
getHandleColor (void) const;
311 EditFieldHandlePtr
editHandleColor (void);
312 GetFieldHandlePtr
getHandleTexture (void) const;
313 EditFieldHandlePtr
editHandleTexture (void);
314 GetFieldHandlePtr
getHandleTexCoords (void) const;
315 EditFieldHandlePtr
editHandleTexCoords (void);
316 GetFieldHandlePtr
getHandleRadialDistortion (void) const;
317 EditFieldHandlePtr
editHandleRadialDistortion(void);
318 GetFieldHandlePtr
getHandleCenterOfDistortion (void) const;
319 EditFieldHandlePtr
editHandleCenterOfDistortion(void);
320 GetFieldHandlePtr
getHandleHor (void) const;
321 EditFieldHandlePtr
editHandleHor (void);
322 GetFieldHandlePtr
getHandleVert (void) const;
323 EditFieldHandlePtr
editHandleVert (void);
326 /*---------------------------------------------------------------------*/
330 #ifdef OSG_MT_CPTR_ASPECT
331 virtual void execSyncV( FieldContainer
&oFrom
,
332 ConstFieldMaskArg whichField
,
333 AspectOffsetStore
&oOffsets
,
334 ConstFieldMaskArg syncMode
,
335 const UInt32 uiSyncInfo
);
337 void execSync ( TextureBackgroundBase
*pFrom
,
338 ConstFieldMaskArg whichField
,
339 AspectOffsetStore
&oOffsets
,
340 ConstFieldMaskArg syncMode
,
341 const UInt32 uiSyncInfo
);
345 /*---------------------------------------------------------------------*/
350 /*---------------------------------------------------------------------*/
351 /*! \name Aspect Create */
354 #ifdef OSG_MT_CPTR_ASPECT
355 virtual FieldContainer
*createAspectCopy(
356 const FieldContainer
*pRefAspect
) const;
360 /*---------------------------------------------------------------------*/
364 /*---------------------------------------------------------------------*/
368 virtual void resolveLinks(void);
371 /*========================== PRIVATE ================================*/
374 /*---------------------------------------------------------------------*/
376 // prohibit default functions (move to 'public' if you need one)
377 void operator =(const TextureBackgroundBase
&source
);
380 typedef TextureBackgroundBase
*TextureBackgroundBaseP
;
384 #endif /* _OSGTEXTUREBACKGROUNDBASE_H_ */