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 GradientBackground
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGGRADIENTBACKGROUNDBASE_H_
55 #define _OSGGRADIENTBACKGROUNDBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGWindowDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGTileableBackground.h" // Parent
68 #include "OSGBaseFields.h" // Color type
69 #include "OSGSysFields.h" // Position type
71 #include "OSGGradientBackgroundFields.h"
76 class GradientBackground
;
78 //! \brief GradientBackground Base Class.
80 class OSG_WINDOW_DLLMAPPING GradientBackgroundBase
: public TileableBackground
84 typedef TileableBackground Inherited
;
85 typedef TileableBackground ParentContainer
;
87 typedef Inherited::TypeObject TypeObject
;
88 typedef TypeObject::InitPhase InitPhase
;
90 OSG_GEN_INTERNALPTR(GradientBackground
);
92 /*========================== PUBLIC =================================*/
98 ColorFieldId
= Inherited::NextFieldId
,
99 PositionFieldId
= ColorFieldId
+ 1,
100 NormPositionFieldId
= PositionFieldId
+ 1,
101 StyleFieldId
= NormPositionFieldId
+ 1,
102 NextFieldId
= StyleFieldId
+ 1
105 static const OSG::BitVector ColorFieldMask
=
106 (TypeTraits
<BitVector
>::One
<< ColorFieldId
);
107 static const OSG::BitVector PositionFieldMask
=
108 (TypeTraits
<BitVector
>::One
<< PositionFieldId
);
109 static const OSG::BitVector NormPositionFieldMask
=
110 (TypeTraits
<BitVector
>::One
<< NormPositionFieldId
);
111 static const OSG::BitVector StyleFieldMask
=
112 (TypeTraits
<BitVector
>::One
<< StyleFieldId
);
113 static const OSG::BitVector NextFieldMask
=
114 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
116 typedef MFColor3f MFColorType
;
117 typedef MFReal32 MFPositionType
;
118 typedef SFBool SFNormPositionType
;
119 typedef SFUInt32 SFStyleType
;
121 /*---------------------------------------------------------------------*/
122 /*! \name Class Get */
125 static FieldContainerType
&getClassType (void);
126 static UInt32
getClassTypeId (void);
127 static UInt16
getClassGroupId(void);
130 /*---------------------------------------------------------------------*/
131 /*! \name FieldContainer Get */
134 virtual FieldContainerType
&getType (void);
135 virtual const FieldContainerType
&getType (void) const;
137 virtual UInt32
getContainerSize(void) const;
140 /*---------------------------------------------------------------------*/
141 /*! \name Field Get */
145 SFUInt32
*editSFStyle (void);
146 const SFUInt32
*getSFStyle (void) const;
149 UInt32
&editStyle (void);
150 UInt32
getStyle (void) const;
153 /*---------------------------------------------------------------------*/
154 /*! \name Field Set */
157 void setStyle (const UInt32 value
);
160 /*---------------------------------------------------------------------*/
161 /*! \name Ptr MField Set */
165 /*---------------------------------------------------------------------*/
166 /*! \name Binary Access */
169 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
170 virtual void copyToBin (BinaryDataHandler
&pMem
,
171 ConstFieldMaskArg whichField
);
172 virtual void copyFromBin(BinaryDataHandler
&pMem
,
173 ConstFieldMaskArg whichField
);
177 /*---------------------------------------------------------------------*/
178 /*! \name Construction */
181 static GradientBackgroundTransitPtr
create (void);
182 static GradientBackground
*createEmpty (void);
184 static GradientBackgroundTransitPtr
createLocal (
185 BitVector bFlags
= FCLocal::All
);
187 static GradientBackground
*createEmptyLocal(
188 BitVector bFlags
= FCLocal::All
);
190 static GradientBackgroundTransitPtr
createDependent (BitVector bFlags
);
193 /*---------------------------------------------------------------------*/
197 virtual FieldContainerTransitPtr
shallowCopy (void) const;
198 virtual FieldContainerTransitPtr
shallowCopyLocal(
199 BitVector bFlags
= FCLocal::All
) const;
200 virtual FieldContainerTransitPtr
shallowCopyDependent(
201 BitVector bFlags
) const;
204 /*========================= PROTECTED ===============================*/
208 static TypeObject _type
;
210 static void classDescInserter(TypeObject
&oType
);
211 static const Char8
*getClassname (void );
213 /*---------------------------------------------------------------------*/
218 MFReal32 _mfPosition
;
219 SFBool _sfNormPosition
;
223 /*---------------------------------------------------------------------*/
224 /*! \name Constructors */
227 GradientBackgroundBase(void);
228 GradientBackgroundBase(const GradientBackgroundBase
&source
);
231 /*---------------------------------------------------------------------*/
232 /*! \name Destructors */
235 virtual ~GradientBackgroundBase(void);
238 /*---------------------------------------------------------------------*/
239 /*! \name onCreate */
244 /*---------------------------------------------------------------------*/
245 /*! \name Generic Field Access */
248 GetFieldHandlePtr
getHandleColor (void) const;
249 EditFieldHandlePtr
editHandleColor (void);
250 GetFieldHandlePtr
getHandlePosition (void) const;
251 EditFieldHandlePtr
editHandlePosition (void);
252 GetFieldHandlePtr
getHandleNormPosition (void) const;
253 EditFieldHandlePtr
editHandleNormPosition (void);
254 GetFieldHandlePtr
getHandleStyle (void) const;
255 EditFieldHandlePtr
editHandleStyle (void);
258 /*---------------------------------------------------------------------*/
259 /*! \name Field Get */
263 MFColor3f
*editMFColor (void);
264 const MFColor3f
*getMFColor (void) const;
266 MFReal32
*editMFPosition (void);
267 const MFReal32
*getMFPosition (void) const;
269 SFBool
*editSFNormPosition (void);
270 const SFBool
*getSFNormPosition (void) const;
273 MFColor3f ::reference
editColor (const UInt32 index
);
274 const Color3f
&getColor (const UInt32 index
) const;
276 MFReal32 ::reference
editPosition (const UInt32 index
);
277 Real32
getPosition (const UInt32 index
) const;
279 bool &editNormPosition (void);
280 bool getNormPosition (void) const;
283 /*---------------------------------------------------------------------*/
284 /*! \name Field Set */
287 void setNormPosition (const bool value
);
290 /*---------------------------------------------------------------------*/
291 /*! \name Ptr MField Set */
295 /*---------------------------------------------------------------------*/
299 #ifdef OSG_MT_CPTR_ASPECT
300 virtual void execSyncV( FieldContainer
&oFrom
,
301 ConstFieldMaskArg whichField
,
302 AspectOffsetStore
&oOffsets
,
303 ConstFieldMaskArg syncMode
,
304 const UInt32 uiSyncInfo
);
306 void execSync ( GradientBackgroundBase
*pFrom
,
307 ConstFieldMaskArg whichField
,
308 AspectOffsetStore
&oOffsets
,
309 ConstFieldMaskArg syncMode
,
310 const UInt32 uiSyncInfo
);
314 /*---------------------------------------------------------------------*/
319 /*---------------------------------------------------------------------*/
320 /*! \name Aspect Create */
323 #ifdef OSG_MT_CPTR_ASPECT
324 virtual FieldContainer
*createAspectCopy(
325 const FieldContainer
*pRefAspect
) const;
329 /*---------------------------------------------------------------------*/
333 /*---------------------------------------------------------------------*/
337 virtual void resolveLinks(void);
340 /*========================== PRIVATE ================================*/
343 /*---------------------------------------------------------------------*/
345 // prohibit default functions (move to 'public' if you need one)
346 void operator =(const GradientBackgroundBase
&source
);
349 typedef GradientBackgroundBase
*GradientBackgroundBaseP
;
353 #endif /* _OSGGRADIENTBACKGROUNDBASE_H_ */