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 **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSTENCILCHUNKBASE_H_
55 #define _OSGSTENCILCHUNKBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGStateDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStateChunk.h" // Parent
68 #include "OSGBaseFields.h" // StencilFunc type
69 #include "OSGSysFields.h" // StencilValue type
71 #include "OSGStencilChunkFields.h"
78 //! \brief StencilChunk Base Class.
80 class OSG_STATE_DLLMAPPING StencilChunkBase
: public StateChunk
84 typedef StateChunk Inherited
;
85 typedef StateChunk ParentContainer
;
87 typedef Inherited::TypeObject TypeObject
;
88 typedef TypeObject::InitPhase InitPhase
;
90 OSG_GEN_INTERNALPTR(StencilChunk
);
92 /*========================== PUBLIC =================================*/
98 StencilFuncFieldId
= Inherited::NextFieldId
,
99 StencilValueFieldId
= StencilFuncFieldId
+ 1,
100 StencilMaskFieldId
= StencilValueFieldId
+ 1,
101 StencilOpFailFieldId
= StencilMaskFieldId
+ 1,
102 StencilOpZFailFieldId
= StencilOpFailFieldId
+ 1,
103 StencilOpZPassFieldId
= StencilOpZFailFieldId
+ 1,
104 ClearBufferFieldId
= StencilOpZPassFieldId
+ 1,
105 BitMaskFieldId
= ClearBufferFieldId
+ 1,
106 NextFieldId
= BitMaskFieldId
+ 1
109 static const OSG::BitVector StencilFuncFieldMask
=
110 (TypeTraits
<BitVector
>::One
<< StencilFuncFieldId
);
111 static const OSG::BitVector StencilValueFieldMask
=
112 (TypeTraits
<BitVector
>::One
<< StencilValueFieldId
);
113 static const OSG::BitVector StencilMaskFieldMask
=
114 (TypeTraits
<BitVector
>::One
<< StencilMaskFieldId
);
115 static const OSG::BitVector StencilOpFailFieldMask
=
116 (TypeTraits
<BitVector
>::One
<< StencilOpFailFieldId
);
117 static const OSG::BitVector StencilOpZFailFieldMask
=
118 (TypeTraits
<BitVector
>::One
<< StencilOpZFailFieldId
);
119 static const OSG::BitVector StencilOpZPassFieldMask
=
120 (TypeTraits
<BitVector
>::One
<< StencilOpZPassFieldId
);
121 static const OSG::BitVector ClearBufferFieldMask
=
122 (TypeTraits
<BitVector
>::One
<< ClearBufferFieldId
);
123 static const OSG::BitVector BitMaskFieldMask
=
124 (TypeTraits
<BitVector
>::One
<< BitMaskFieldId
);
125 static const OSG::BitVector NextFieldMask
=
126 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
128 typedef SFGLenum SFStencilFuncType
;
129 typedef SFInt32 SFStencilValueType
;
130 typedef SFUInt32 SFStencilMaskType
;
131 typedef SFGLenum SFStencilOpFailType
;
132 typedef SFGLenum SFStencilOpZFailType
;
133 typedef SFGLenum SFStencilOpZPassType
;
134 typedef SFInt32 SFClearBufferType
;
135 typedef SFUInt32 SFBitMaskType
;
137 /*---------------------------------------------------------------------*/
138 /*! \name Class Get */
141 static FieldContainerType
&getClassType (void);
142 static UInt32
getClassTypeId (void);
143 static UInt16
getClassGroupId(void);
146 /*---------------------------------------------------------------------*/
147 /*! \name FieldContainer Get */
150 virtual FieldContainerType
&getType (void);
151 virtual const FieldContainerType
&getType (void) const;
153 virtual UInt32
getContainerSize(void) const;
156 /*---------------------------------------------------------------------*/
157 /*! \name Field Get */
161 SFGLenum
*editSFStencilFunc (void);
162 const SFGLenum
*getSFStencilFunc (void) const;
164 SFInt32
*editSFStencilValue (void);
165 const SFInt32
*getSFStencilValue (void) const;
167 SFUInt32
*editSFStencilMask (void);
168 const SFUInt32
*getSFStencilMask (void) const;
170 SFGLenum
*editSFStencilOpFail (void);
171 const SFGLenum
*getSFStencilOpFail (void) const;
173 SFGLenum
*editSFStencilOpZFail (void);
174 const SFGLenum
*getSFStencilOpZFail (void) const;
176 SFGLenum
*editSFStencilOpZPass (void);
177 const SFGLenum
*getSFStencilOpZPass (void) const;
179 SFInt32
*editSFClearBuffer (void);
180 const SFInt32
*getSFClearBuffer (void) const;
182 SFUInt32
*editSFBitMask (void);
183 const SFUInt32
*getSFBitMask (void) const;
186 GLenum
&editStencilFunc (void);
187 const GLenum
&getStencilFunc (void) const;
189 Int32
&editStencilValue (void);
190 Int32
getStencilValue (void) const;
192 UInt32
&editStencilMask (void);
193 UInt32
getStencilMask (void) const;
195 GLenum
&editStencilOpFail (void);
196 const GLenum
&getStencilOpFail (void) const;
198 GLenum
&editStencilOpZFail (void);
199 const GLenum
&getStencilOpZFail (void) const;
201 GLenum
&editStencilOpZPass (void);
202 const GLenum
&getStencilOpZPass (void) const;
204 Int32
&editClearBuffer (void);
205 Int32
getClearBuffer (void) const;
207 UInt32
&editBitMask (void);
208 UInt32
getBitMask (void) const;
211 /*---------------------------------------------------------------------*/
212 /*! \name Field Set */
215 void setStencilFunc (const GLenum
&value
);
216 void setStencilValue (const Int32 value
);
217 void setStencilMask (const UInt32 value
);
218 void setStencilOpFail (const GLenum
&value
);
219 void setStencilOpZFail (const GLenum
&value
);
220 void setStencilOpZPass (const GLenum
&value
);
221 void setClearBuffer (const Int32 value
);
222 void setBitMask (const UInt32 value
);
225 /*---------------------------------------------------------------------*/
226 /*! \name Ptr MField Set */
230 /*---------------------------------------------------------------------*/
231 /*! \name Binary Access */
234 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
235 virtual void copyToBin (BinaryDataHandler
&pMem
,
236 ConstFieldMaskArg whichField
);
237 virtual void copyFromBin(BinaryDataHandler
&pMem
,
238 ConstFieldMaskArg whichField
);
242 /*---------------------------------------------------------------------*/
243 /*! \name Construction */
246 static StencilChunkTransitPtr
create (void);
247 static StencilChunk
*createEmpty (void);
249 static StencilChunkTransitPtr
createLocal (
250 BitVector bFlags
= FCLocal::All
);
252 static StencilChunk
*createEmptyLocal(
253 BitVector bFlags
= FCLocal::All
);
255 static StencilChunkTransitPtr
createDependent (BitVector bFlags
);
258 /*---------------------------------------------------------------------*/
262 virtual FieldContainerTransitPtr
shallowCopy (void) const;
263 virtual FieldContainerTransitPtr
shallowCopyLocal(
264 BitVector bFlags
= FCLocal::All
) const;
265 virtual FieldContainerTransitPtr
shallowCopyDependent(
266 BitVector bFlags
) const;
269 /*========================= PROTECTED ===============================*/
273 static TypeObject _type
;
275 static void classDescInserter(TypeObject
&oType
);
276 static const Char8
*getClassname (void );
278 /*---------------------------------------------------------------------*/
282 SFGLenum _sfStencilFunc
;
283 SFInt32 _sfStencilValue
;
284 SFUInt32 _sfStencilMask
;
285 SFGLenum _sfStencilOpFail
;
286 SFGLenum _sfStencilOpZFail
;
287 SFGLenum _sfStencilOpZPass
;
288 SFInt32 _sfClearBuffer
;
292 /*---------------------------------------------------------------------*/
293 /*! \name Constructors */
296 StencilChunkBase(void);
297 StencilChunkBase(const StencilChunkBase
&source
);
300 /*---------------------------------------------------------------------*/
301 /*! \name Destructors */
304 virtual ~StencilChunkBase(void);
307 /*---------------------------------------------------------------------*/
308 /*! \name onCreate */
313 /*---------------------------------------------------------------------*/
314 /*! \name Generic Field Access */
317 GetFieldHandlePtr
getHandleStencilFunc (void) const;
318 EditFieldHandlePtr
editHandleStencilFunc (void);
319 GetFieldHandlePtr
getHandleStencilValue (void) const;
320 EditFieldHandlePtr
editHandleStencilValue (void);
321 GetFieldHandlePtr
getHandleStencilMask (void) const;
322 EditFieldHandlePtr
editHandleStencilMask (void);
323 GetFieldHandlePtr
getHandleStencilOpFail (void) const;
324 EditFieldHandlePtr
editHandleStencilOpFail (void);
325 GetFieldHandlePtr
getHandleStencilOpZFail (void) const;
326 EditFieldHandlePtr
editHandleStencilOpZFail (void);
327 GetFieldHandlePtr
getHandleStencilOpZPass (void) const;
328 EditFieldHandlePtr
editHandleStencilOpZPass (void);
329 GetFieldHandlePtr
getHandleClearBuffer (void) const;
330 EditFieldHandlePtr
editHandleClearBuffer (void);
331 GetFieldHandlePtr
getHandleBitMask (void) const;
332 EditFieldHandlePtr
editHandleBitMask (void);
335 /*---------------------------------------------------------------------*/
339 #ifdef OSG_MT_CPTR_ASPECT
340 virtual void execSyncV( FieldContainer
&oFrom
,
341 ConstFieldMaskArg whichField
,
342 AspectOffsetStore
&oOffsets
,
343 ConstFieldMaskArg syncMode
,
344 const UInt32 uiSyncInfo
);
346 void execSync ( StencilChunkBase
*pFrom
,
347 ConstFieldMaskArg whichField
,
348 AspectOffsetStore
&oOffsets
,
349 ConstFieldMaskArg syncMode
,
350 const UInt32 uiSyncInfo
);
354 /*---------------------------------------------------------------------*/
359 /*---------------------------------------------------------------------*/
360 /*! \name Aspect Create */
363 #ifdef OSG_MT_CPTR_ASPECT
364 virtual FieldContainer
*createAspectCopy(
365 const FieldContainer
*pRefAspect
) const;
369 /*---------------------------------------------------------------------*/
373 /*---------------------------------------------------------------------*/
377 virtual void resolveLinks(void);
380 /*========================== PRIVATE ================================*/
383 /*---------------------------------------------------------------------*/
385 // prohibit default functions (move to 'public' if you need one)
386 void operator =(const StencilChunkBase
&source
);
389 typedef StencilChunkBase
*StencilChunkBaseP
;
393 #endif /* _OSGSTENCILCHUNKBASE_H_ */