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 TextureImageChunk
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGTEXTUREIMAGECHUNKBASE_H_
55 #define _OSGTEXTUREIMAGECHUNKBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGStateDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStateChunk.h" // Parent
68 #include "OSGTextureBaseChunkFields.h" // Texture type
69 #include "OSGSysFields.h" // Level type
70 #include "OSGBaseFields.h" // Access type
72 #include "OSGTextureImageChunkFields.h"
77 class TextureImageChunk
;
79 //! \brief TextureImageChunk Base Class.
81 class OSG_STATE_DLLMAPPING TextureImageChunkBase
: public StateChunk
85 typedef StateChunk Inherited
;
86 typedef StateChunk ParentContainer
;
88 typedef Inherited::TypeObject TypeObject
;
89 typedef TypeObject::InitPhase InitPhase
;
91 OSG_GEN_INTERNALPTR(TextureImageChunk
);
93 /*========================== PUBLIC =================================*/
99 TextureFieldId
= Inherited::NextFieldId
,
100 LevelFieldId
= TextureFieldId
+ 1,
101 LayerFieldId
= LevelFieldId
+ 1,
102 AccessFieldId
= LayerFieldId
+ 1,
103 FormatFieldId
= AccessFieldId
+ 1,
104 NextFieldId
= FormatFieldId
+ 1
107 static const OSG::BitVector TextureFieldMask
=
108 (TypeTraits
<BitVector
>::One
<< TextureFieldId
);
109 static const OSG::BitVector LevelFieldMask
=
110 (TypeTraits
<BitVector
>::One
<< LevelFieldId
);
111 static const OSG::BitVector LayerFieldMask
=
112 (TypeTraits
<BitVector
>::One
<< LayerFieldId
);
113 static const OSG::BitVector AccessFieldMask
=
114 (TypeTraits
<BitVector
>::One
<< AccessFieldId
);
115 static const OSG::BitVector FormatFieldMask
=
116 (TypeTraits
<BitVector
>::One
<< FormatFieldId
);
117 static const OSG::BitVector NextFieldMask
=
118 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
120 typedef SFUnrecTextureBaseChunkPtr SFTextureType
;
121 typedef SFInt32 SFLevelType
;
122 typedef SFInt32 SFLayerType
;
123 typedef SFGLenum SFAccessType
;
124 typedef SFGLenum SFFormatType
;
126 /*---------------------------------------------------------------------*/
127 /*! \name Class Get */
130 static FieldContainerType
&getClassType (void);
131 static UInt32
getClassTypeId (void);
132 static UInt16
getClassGroupId(void);
135 /*---------------------------------------------------------------------*/
136 /*! \name FieldContainer Get */
139 virtual FieldContainerType
&getType (void);
140 virtual const FieldContainerType
&getType (void) const;
142 virtual UInt32
getContainerSize(void) const;
145 /*---------------------------------------------------------------------*/
146 /*! \name Field Get */
149 const SFUnrecTextureBaseChunkPtr
*getSFTexture (void) const;
150 SFUnrecTextureBaseChunkPtr
*editSFTexture (void);
152 SFInt32
*editSFLevel (void);
153 const SFInt32
*getSFLevel (void) const;
155 SFInt32
*editSFLayer (void);
156 const SFInt32
*getSFLayer (void) const;
158 SFGLenum
*editSFAccess (void);
159 const SFGLenum
*getSFAccess (void) const;
161 SFGLenum
*editSFFormat (void);
162 const SFGLenum
*getSFFormat (void) const;
165 TextureBaseChunk
* getTexture (void) const;
167 Int32
&editLevel (void);
168 Int32
getLevel (void) const;
170 Int32
&editLayer (void);
171 Int32
getLayer (void) const;
173 GLenum
&editAccess (void);
174 const GLenum
&getAccess (void) const;
176 GLenum
&editFormat (void);
177 const GLenum
&getFormat (void) const;
180 /*---------------------------------------------------------------------*/
181 /*! \name Field Set */
184 void setTexture (TextureBaseChunk
* const value
);
185 void setLevel (const Int32 value
);
186 void setLayer (const Int32 value
);
187 void setAccess (const GLenum
&value
);
188 void setFormat (const GLenum
&value
);
191 /*---------------------------------------------------------------------*/
192 /*! \name Ptr Field Set */
196 /*---------------------------------------------------------------------*/
197 /*! \name Ptr MField Set */
201 /*---------------------------------------------------------------------*/
202 /*! \name Binary Access */
205 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
206 virtual void copyToBin (BinaryDataHandler
&pMem
,
207 ConstFieldMaskArg whichField
);
208 virtual void copyFromBin(BinaryDataHandler
&pMem
,
209 ConstFieldMaskArg whichField
);
213 /*---------------------------------------------------------------------*/
214 /*! \name Construction */
217 static TextureImageChunkTransitPtr
create (void);
218 static TextureImageChunk
*createEmpty (void);
220 static TextureImageChunkTransitPtr
createLocal (
221 BitVector bFlags
= FCLocal::All
);
223 static TextureImageChunk
*createEmptyLocal(
224 BitVector bFlags
= FCLocal::All
);
226 static TextureImageChunkTransitPtr
createDependent (BitVector bFlags
);
229 /*---------------------------------------------------------------------*/
233 virtual FieldContainerTransitPtr
shallowCopy (void) const;
234 virtual FieldContainerTransitPtr
shallowCopyLocal(
235 BitVector bFlags
= FCLocal::All
) const;
236 virtual FieldContainerTransitPtr
shallowCopyDependent(
237 BitVector bFlags
) const;
240 /*========================= PROTECTED ===============================*/
244 static TypeObject _type
;
246 static void classDescInserter(TypeObject
&oType
);
247 static const Char8
*getClassname (void );
249 /*---------------------------------------------------------------------*/
253 SFUnrecTextureBaseChunkPtr _sfTexture
;
260 /*---------------------------------------------------------------------*/
261 /*! \name Constructors */
264 TextureImageChunkBase(void);
265 TextureImageChunkBase(const TextureImageChunkBase
&source
);
268 /*---------------------------------------------------------------------*/
269 /*! \name Destructors */
272 virtual ~TextureImageChunkBase(void);
275 /*---------------------------------------------------------------------*/
276 /*! \name onCreate */
279 void onCreate(const TextureImageChunk
*source
= NULL
);
282 /*---------------------------------------------------------------------*/
283 /*! \name Generic Field Access */
286 GetFieldHandlePtr
getHandleTexture (void) const;
287 EditFieldHandlePtr
editHandleTexture (void);
288 GetFieldHandlePtr
getHandleLevel (void) const;
289 EditFieldHandlePtr
editHandleLevel (void);
290 GetFieldHandlePtr
getHandleLayer (void) const;
291 EditFieldHandlePtr
editHandleLayer (void);
292 GetFieldHandlePtr
getHandleAccess (void) const;
293 EditFieldHandlePtr
editHandleAccess (void);
294 GetFieldHandlePtr
getHandleFormat (void) const;
295 EditFieldHandlePtr
editHandleFormat (void);
298 /*---------------------------------------------------------------------*/
302 #ifdef OSG_MT_CPTR_ASPECT
303 virtual void execSyncV( FieldContainer
&oFrom
,
304 ConstFieldMaskArg whichField
,
305 AspectOffsetStore
&oOffsets
,
306 ConstFieldMaskArg syncMode
,
307 const UInt32 uiSyncInfo
);
309 void execSync ( TextureImageChunkBase
*pFrom
,
310 ConstFieldMaskArg whichField
,
311 AspectOffsetStore
&oOffsets
,
312 ConstFieldMaskArg syncMode
,
313 const UInt32 uiSyncInfo
);
317 /*---------------------------------------------------------------------*/
322 /*---------------------------------------------------------------------*/
323 /*! \name Aspect Create */
326 #ifdef OSG_MT_CPTR_ASPECT
327 virtual FieldContainer
*createAspectCopy(
328 const FieldContainer
*pRefAspect
) const;
332 /*---------------------------------------------------------------------*/
336 /*---------------------------------------------------------------------*/
340 virtual void resolveLinks(void);
343 /*========================== PRIVATE ================================*/
346 /*---------------------------------------------------------------------*/
348 // prohibit default functions (move to 'public' if you need one)
349 void operator =(const TextureImageChunkBase
&source
);
352 typedef TextureImageChunkBase
*TextureImageChunkBaseP
;
356 #endif /* _OSGTEXTUREIMAGECHUNKBASE_H_ */