added: helper to put chunk override groups in OSG files
[opensg.git] / Source / System / State / Base / OSGPolygonChunkBase.h
blob01c9cadbd7185d4e93ab7c5378f5f19749dafa84
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 /*****************************************************************************\
40 *****************************************************************************
41 ** **
42 ** This file is automatically generated. **
43 ** **
44 ** Any changes made to this file WILL be lost when it is **
45 ** regenerated, which can become necessary at any time. **
46 ** **
47 ** Do not change this file, changes should be done in the derived **
48 ** class PolygonChunk
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGPOLYGONCHUNKBASE_H_
55 #define _OSGPOLYGONCHUNKBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
61 #include "OSGConfig.h"
62 #include "OSGSystemDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStateChunk.h" // Parent
68 #include "OSGBaseFields.h" // CullFace type
69 #include "OSGSysFields.h" // Smooth type
71 #include "OSGPolygonChunkFields.h"
73 OSG_BEGIN_NAMESPACE
76 class PolygonChunk;
78 //! \brief PolygonChunk Base Class.
80 class OSG_SYSTEM_DLLMAPPING PolygonChunkBase : public StateChunk
82 public:
84 typedef StateChunk Inherited;
85 typedef StateChunk ParentContainer;
87 typedef Inherited::TypeObject TypeObject;
88 typedef TypeObject::InitPhase InitPhase;
90 OSG_GEN_INTERNALPTR(PolygonChunk);
92 /*========================== PUBLIC =================================*/
94 public:
96 enum
98 CullFaceFieldId = Inherited::NextFieldId,
99 FrontFaceFieldId = CullFaceFieldId + 1,
100 FrontModeFieldId = FrontFaceFieldId + 1,
101 BackModeFieldId = FrontModeFieldId + 1,
102 SmoothFieldId = BackModeFieldId + 1,
103 OffsetFactorFieldId = SmoothFieldId + 1,
104 OffsetBiasFieldId = OffsetFactorFieldId + 1,
105 OffsetPointFieldId = OffsetBiasFieldId + 1,
106 OffsetLineFieldId = OffsetPointFieldId + 1,
107 OffsetFillFieldId = OffsetLineFieldId + 1,
108 StippleFieldId = OffsetFillFieldId + 1,
109 NextFieldId = StippleFieldId + 1
112 static const OSG::BitVector CullFaceFieldMask =
113 (TypeTraits<BitVector>::One << CullFaceFieldId);
114 static const OSG::BitVector FrontFaceFieldMask =
115 (TypeTraits<BitVector>::One << FrontFaceFieldId);
116 static const OSG::BitVector FrontModeFieldMask =
117 (TypeTraits<BitVector>::One << FrontModeFieldId);
118 static const OSG::BitVector BackModeFieldMask =
119 (TypeTraits<BitVector>::One << BackModeFieldId);
120 static const OSG::BitVector SmoothFieldMask =
121 (TypeTraits<BitVector>::One << SmoothFieldId);
122 static const OSG::BitVector OffsetFactorFieldMask =
123 (TypeTraits<BitVector>::One << OffsetFactorFieldId);
124 static const OSG::BitVector OffsetBiasFieldMask =
125 (TypeTraits<BitVector>::One << OffsetBiasFieldId);
126 static const OSG::BitVector OffsetPointFieldMask =
127 (TypeTraits<BitVector>::One << OffsetPointFieldId);
128 static const OSG::BitVector OffsetLineFieldMask =
129 (TypeTraits<BitVector>::One << OffsetLineFieldId);
130 static const OSG::BitVector OffsetFillFieldMask =
131 (TypeTraits<BitVector>::One << OffsetFillFieldId);
132 static const OSG::BitVector StippleFieldMask =
133 (TypeTraits<BitVector>::One << StippleFieldId);
134 static const OSG::BitVector NextFieldMask =
135 (TypeTraits<BitVector>::One << NextFieldId);
137 typedef SFGLenum SFCullFaceType;
138 typedef SFGLenum SFFrontFaceType;
139 typedef SFGLenum SFFrontModeType;
140 typedef SFGLenum SFBackModeType;
141 typedef SFBool SFSmoothType;
142 typedef SFReal32 SFOffsetFactorType;
143 typedef SFReal32 SFOffsetBiasType;
144 typedef SFBool SFOffsetPointType;
145 typedef SFBool SFOffsetLineType;
146 typedef SFBool SFOffsetFillType;
147 typedef MFInt32 MFStippleType;
149 /*---------------------------------------------------------------------*/
150 /*! \name Class Get */
151 /*! \{ */
153 static FieldContainerType &getClassType (void);
154 static UInt32 getClassTypeId (void);
155 static UInt16 getClassGroupId(void);
157 /*! \} */
158 /*---------------------------------------------------------------------*/
159 /*! \name FieldContainer Get */
160 /*! \{ */
162 virtual FieldContainerType &getType (void);
163 virtual const FieldContainerType &getType (void) const;
165 virtual UInt32 getContainerSize(void) const;
167 /*! \} */
168 /*---------------------------------------------------------------------*/
169 /*! \name Field Get */
170 /*! \{ */
173 SFGLenum *editSFCullFace (void);
174 const SFGLenum *getSFCullFace (void) const;
176 SFGLenum *editSFFrontFace (void);
177 const SFGLenum *getSFFrontFace (void) const;
179 SFGLenum *editSFFrontMode (void);
180 const SFGLenum *getSFFrontMode (void) const;
182 SFGLenum *editSFBackMode (void);
183 const SFGLenum *getSFBackMode (void) const;
185 SFBool *editSFSmooth (void);
186 const SFBool *getSFSmooth (void) const;
188 SFReal32 *editSFOffsetFactor (void);
189 const SFReal32 *getSFOffsetFactor (void) const;
191 SFReal32 *editSFOffsetBias (void);
192 const SFReal32 *getSFOffsetBias (void) const;
194 SFBool *editSFOffsetPoint (void);
195 const SFBool *getSFOffsetPoint (void) const;
197 SFBool *editSFOffsetLine (void);
198 const SFBool *getSFOffsetLine (void) const;
200 SFBool *editSFOffsetFill (void);
201 const SFBool *getSFOffsetFill (void) const;
203 MFInt32 *editMFStipple (void);
204 const MFInt32 *getMFStipple (void) const;
207 GLenum &editCullFace (void);
208 const GLenum &getCullFace (void) const;
210 GLenum &editFrontFace (void);
211 const GLenum &getFrontFace (void) const;
213 GLenum &editFrontMode (void);
214 const GLenum &getFrontMode (void) const;
216 GLenum &editBackMode (void);
217 const GLenum &getBackMode (void) const;
219 bool &editSmooth (void);
220 bool getSmooth (void) const;
222 Real32 &editOffsetFactor (void);
223 Real32 getOffsetFactor (void) const;
225 Real32 &editOffsetBias (void);
226 Real32 getOffsetBias (void) const;
228 bool &editOffsetPoint (void);
229 bool getOffsetPoint (void) const;
231 bool &editOffsetLine (void);
232 bool getOffsetLine (void) const;
234 bool &editOffsetFill (void);
235 bool getOffsetFill (void) const;
237 Int32 &editStipple (const UInt32 index);
238 Int32 getStipple (const UInt32 index) const;
240 /*! \} */
241 /*---------------------------------------------------------------------*/
242 /*! \name Field Set */
243 /*! \{ */
245 void setCullFace (const GLenum &value);
246 void setFrontFace (const GLenum &value);
247 void setFrontMode (const GLenum &value);
248 void setBackMode (const GLenum &value);
249 void setSmooth (const bool value);
250 void setOffsetFactor (const Real32 value);
251 void setOffsetBias (const Real32 value);
252 void setOffsetPoint (const bool value);
253 void setOffsetLine (const bool value);
254 void setOffsetFill (const bool value);
256 /*! \} */
257 /*---------------------------------------------------------------------*/
258 /*! \name Ptr MField Set */
259 /*! \{ */
261 /*! \} */
262 /*---------------------------------------------------------------------*/
263 /*! \name Binary Access */
264 /*! \{ */
266 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
267 virtual void copyToBin (BinaryDataHandler &pMem,
268 ConstFieldMaskArg whichField);
269 virtual void copyFromBin(BinaryDataHandler &pMem,
270 ConstFieldMaskArg whichField);
273 /*! \} */
274 /*---------------------------------------------------------------------*/
275 /*! \name Construction */
276 /*! \{ */
278 static PolygonChunkTransitPtr create (void);
279 static PolygonChunk *createEmpty (void);
281 static PolygonChunkTransitPtr createLocal (
282 BitVector bFlags = FCLocal::All);
284 static PolygonChunk *createEmptyLocal(
285 BitVector bFlags = FCLocal::All);
287 static PolygonChunkTransitPtr createDependent (BitVector bFlags);
289 /*! \} */
290 /*---------------------------------------------------------------------*/
291 /*! \name Copy */
292 /*! \{ */
294 virtual FieldContainerTransitPtr shallowCopy (void) const;
295 virtual FieldContainerTransitPtr shallowCopyLocal(
296 BitVector bFlags = FCLocal::All) const;
297 virtual FieldContainerTransitPtr shallowCopyDependent(
298 BitVector bFlags) const;
300 /*! \} */
301 /*========================= PROTECTED ===============================*/
303 protected:
305 static TypeObject _type;
307 static void classDescInserter(TypeObject &oType);
308 static const Char8 *getClassname (void );
310 /*---------------------------------------------------------------------*/
311 /*! \name Fields */
312 /*! \{ */
314 SFGLenum _sfCullFace;
315 SFGLenum _sfFrontFace;
316 SFGLenum _sfFrontMode;
317 SFGLenum _sfBackMode;
318 SFBool _sfSmooth;
319 SFReal32 _sfOffsetFactor;
320 SFReal32 _sfOffsetBias;
321 SFBool _sfOffsetPoint;
322 SFBool _sfOffsetLine;
323 SFBool _sfOffsetFill;
324 MFInt32 _mfStipple;
326 /*! \} */
327 /*---------------------------------------------------------------------*/
328 /*! \name Constructors */
329 /*! \{ */
331 PolygonChunkBase(void);
332 PolygonChunkBase(const PolygonChunkBase &source);
334 /*! \} */
335 /*---------------------------------------------------------------------*/
336 /*! \name Destructors */
337 /*! \{ */
339 virtual ~PolygonChunkBase(void);
341 /*! \} */
342 /*---------------------------------------------------------------------*/
343 /*! \name onCreate */
344 /*! \{ */
347 /*! \} */
348 /*---------------------------------------------------------------------*/
349 /*! \name Generic Field Access */
350 /*! \{ */
352 GetFieldHandlePtr getHandleCullFace (void) const;
353 EditFieldHandlePtr editHandleCullFace (void);
354 GetFieldHandlePtr getHandleFrontFace (void) const;
355 EditFieldHandlePtr editHandleFrontFace (void);
356 GetFieldHandlePtr getHandleFrontMode (void) const;
357 EditFieldHandlePtr editHandleFrontMode (void);
358 GetFieldHandlePtr getHandleBackMode (void) const;
359 EditFieldHandlePtr editHandleBackMode (void);
360 GetFieldHandlePtr getHandleSmooth (void) const;
361 EditFieldHandlePtr editHandleSmooth (void);
362 GetFieldHandlePtr getHandleOffsetFactor (void) const;
363 EditFieldHandlePtr editHandleOffsetFactor (void);
364 GetFieldHandlePtr getHandleOffsetBias (void) const;
365 EditFieldHandlePtr editHandleOffsetBias (void);
366 GetFieldHandlePtr getHandleOffsetPoint (void) const;
367 EditFieldHandlePtr editHandleOffsetPoint (void);
368 GetFieldHandlePtr getHandleOffsetLine (void) const;
369 EditFieldHandlePtr editHandleOffsetLine (void);
370 GetFieldHandlePtr getHandleOffsetFill (void) const;
371 EditFieldHandlePtr editHandleOffsetFill (void);
372 GetFieldHandlePtr getHandleStipple (void) const;
373 EditFieldHandlePtr editHandleStipple (void);
375 /*! \} */
376 /*---------------------------------------------------------------------*/
377 /*! \name Sync */
378 /*! \{ */
380 #ifdef OSG_MT_CPTR_ASPECT
381 virtual void execSyncV( FieldContainer &oFrom,
382 ConstFieldMaskArg whichField,
383 AspectOffsetStore &oOffsets,
384 ConstFieldMaskArg syncMode ,
385 const UInt32 uiSyncInfo);
387 void execSync ( PolygonChunkBase *pFrom,
388 ConstFieldMaskArg whichField,
389 AspectOffsetStore &oOffsets,
390 ConstFieldMaskArg syncMode ,
391 const UInt32 uiSyncInfo);
392 #endif
394 /*! \} */
395 /*---------------------------------------------------------------------*/
396 /*! \name Edit */
397 /*! \{ */
399 /*! \} */
400 /*---------------------------------------------------------------------*/
401 /*! \name Aspect Create */
402 /*! \{ */
404 #ifdef OSG_MT_CPTR_ASPECT
405 virtual FieldContainer *createAspectCopy(
406 const FieldContainer *pRefAspect) const;
407 #endif
409 /*! \} */
410 /*---------------------------------------------------------------------*/
411 /*! \name Edit */
412 /*! \{ */
413 /*! \} */
414 /*---------------------------------------------------------------------*/
415 /*! \name Sync */
416 /*! \{ */
418 virtual void resolveLinks(void);
420 /*! \} */
421 /*========================== PRIVATE ================================*/
423 private:
424 /*---------------------------------------------------------------------*/
426 // prohibit default functions (move to 'public' if you need one)
427 void operator =(const PolygonChunkBase &source);
430 typedef PolygonChunkBase *PolygonChunkBaseP;
432 OSG_END_NAMESPACE
434 #endif /* _OSGPOLYGONCHUNKBASE_H_ */