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 ShaderShadowMapEngineData
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADERSHADOWMAPENGINEDATABASE_H_
55 #define _OSGSHADERSHADOWMAPENGINEDATABASE_H_
61 #include "OSGConfig.h"
62 #include "OSGGroupDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGStageData.h" // Parent
68 #include "OSGFrameBufferObjectFields.h" // RenderTargets type
69 #include "OSGTextureBufferFields.h" // ShadowTexBuffers type
70 #include "OSGTextureObjChunkFields.h" // ShadowTexChunk type
71 #include "OSGImageFields.h" // ShadowTexImage type
72 #include "OSGChunkMaterialFields.h" // LightPassMaterials type
73 #include "OSGBackgroundFields.h" // Background type
75 #include "OSGShaderShadowMapEngineDataFields.h"
80 class ShaderShadowMapEngineData
;
82 //! \brief ShaderShadowMapEngineData Base Class.
84 class OSG_GROUP_DLLMAPPING ShaderShadowMapEngineDataBase
: public StageData
88 typedef StageData Inherited
;
89 typedef StageData ParentContainer
;
91 typedef Inherited::TypeObject TypeObject
;
92 typedef TypeObject::InitPhase InitPhase
;
94 OSG_GEN_INTERNALPTR(ShaderShadowMapEngineData
);
96 /*========================== PUBLIC =================================*/
102 RenderTargetsFieldId
= Inherited::NextFieldId
,
103 ShadowTexBuffersFieldId
= RenderTargetsFieldId
+ 1,
104 ShadowTexChunkFieldId
= ShadowTexBuffersFieldId
+ 1,
105 ShadowTexImageFieldId
= ShadowTexChunkFieldId
+ 1,
106 LightPassMaterialsFieldId
= ShadowTexImageFieldId
+ 1,
107 BackgroundFieldId
= LightPassMaterialsFieldId
+ 1,
108 NextFieldId
= BackgroundFieldId
+ 1
111 static const OSG::BitVector RenderTargetsFieldMask
=
112 (TypeTraits
<BitVector
>::One
<< RenderTargetsFieldId
);
113 static const OSG::BitVector ShadowTexBuffersFieldMask
=
114 (TypeTraits
<BitVector
>::One
<< ShadowTexBuffersFieldId
);
115 static const OSG::BitVector ShadowTexChunkFieldMask
=
116 (TypeTraits
<BitVector
>::One
<< ShadowTexChunkFieldId
);
117 static const OSG::BitVector ShadowTexImageFieldMask
=
118 (TypeTraits
<BitVector
>::One
<< ShadowTexImageFieldId
);
119 static const OSG::BitVector LightPassMaterialsFieldMask
=
120 (TypeTraits
<BitVector
>::One
<< LightPassMaterialsFieldId
);
121 static const OSG::BitVector BackgroundFieldMask
=
122 (TypeTraits
<BitVector
>::One
<< BackgroundFieldId
);
123 static const OSG::BitVector NextFieldMask
=
124 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
126 typedef MFUnrecFrameBufferObjectPtr MFRenderTargetsType
;
127 typedef MFUnrecTextureBufferPtr MFShadowTexBuffersType
;
128 typedef SFUnrecTextureObjChunkPtr SFShadowTexChunkType
;
129 typedef SFUnrecImagePtr SFShadowTexImageType
;
130 typedef MFUnrecChunkMaterialPtr MFLightPassMaterialsType
;
131 typedef SFUnrecBackgroundPtr SFBackgroundType
;
133 /*---------------------------------------------------------------------*/
134 /*! \name Class Get */
137 static FieldContainerType
&getClassType (void);
138 static UInt32
getClassTypeId (void);
139 static UInt16
getClassGroupId(void);
142 /*---------------------------------------------------------------------*/
143 /*! \name FieldContainer Get */
146 virtual FieldContainerType
&getType (void);
147 virtual const FieldContainerType
&getType (void) const;
149 virtual UInt32
getContainerSize(void) const;
152 /*---------------------------------------------------------------------*/
153 /*! \name Field Get */
156 const MFUnrecFrameBufferObjectPtr
*getMFRenderTargets (void) const;
157 MFUnrecFrameBufferObjectPtr
*editMFRenderTargets (void);
158 const MFUnrecTextureBufferPtr
*getMFShadowTexBuffers(void) const;
159 MFUnrecTextureBufferPtr
*editMFShadowTexBuffers(void);
160 const SFUnrecTextureObjChunkPtr
*getSFShadowTexChunk (void) const;
161 SFUnrecTextureObjChunkPtr
*editSFShadowTexChunk (void);
162 const SFUnrecImagePtr
*getSFShadowTexImage (void) const;
163 SFUnrecImagePtr
*editSFShadowTexImage (void);
164 const MFUnrecChunkMaterialPtr
*getMFLightPassMaterials(void) const;
165 MFUnrecChunkMaterialPtr
*editMFLightPassMaterials(void);
166 const SFUnrecBackgroundPtr
*getSFBackground (void) const;
167 SFUnrecBackgroundPtr
*editSFBackground (void);
170 FrameBufferObject
* getRenderTargets (const UInt32 index
) const;
172 TextureBuffer
* getShadowTexBuffers(const UInt32 index
) const;
174 TextureObjChunk
* getShadowTexChunk (void) const;
176 Image
* getShadowTexImage (void) const;
178 ChunkMaterial
* getLightPassMaterials(const UInt32 index
) const;
180 Background
* getBackground (void) const;
183 /*---------------------------------------------------------------------*/
184 /*! \name Field Set */
187 void setShadowTexChunk (TextureObjChunk
* const value
);
188 void setShadowTexImage (Image
* const value
);
189 void setBackground (Background
* const value
);
192 /*---------------------------------------------------------------------*/
193 /*! \name Ptr Field Set */
197 /*---------------------------------------------------------------------*/
198 /*! \name Ptr MField Set */
201 void pushToRenderTargets (FrameBufferObject
* const value
);
202 void assignRenderTargets (const MFUnrecFrameBufferObjectPtr
&value
);
203 void removeFromRenderTargets (UInt32 uiIndex
);
204 void removeObjFromRenderTargets(FrameBufferObject
* const value
);
205 void clearRenderTargets (void );
207 void pushToShadowTexBuffers (TextureBuffer
* const value
);
208 void assignShadowTexBuffers (const MFUnrecTextureBufferPtr
&value
);
209 void removeFromShadowTexBuffers (UInt32 uiIndex
);
210 void removeObjFromShadowTexBuffers(TextureBuffer
* const value
);
211 void clearShadowTexBuffers (void );
213 void pushToLightPassMaterials (ChunkMaterial
* const value
);
214 void assignLightPassMaterials (const MFUnrecChunkMaterialPtr
&value
);
215 void removeFromLightPassMaterials (UInt32 uiIndex
);
216 void removeObjFromLightPassMaterials(ChunkMaterial
* const value
);
217 void clearLightPassMaterials (void );
220 /*---------------------------------------------------------------------*/
221 /*! \name Binary Access */
224 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
225 virtual void copyToBin (BinaryDataHandler
&pMem
,
226 ConstFieldMaskArg whichField
);
227 virtual void copyFromBin(BinaryDataHandler
&pMem
,
228 ConstFieldMaskArg whichField
);
232 /*---------------------------------------------------------------------*/
233 /*! \name Construction */
236 static ShaderShadowMapEngineDataTransitPtr
create (void);
237 static ShaderShadowMapEngineData
*createEmpty (void);
239 static ShaderShadowMapEngineDataTransitPtr
createLocal (
240 BitVector bFlags
= FCLocal::All
);
242 static ShaderShadowMapEngineData
*createEmptyLocal(
243 BitVector bFlags
= FCLocal::All
);
245 static ShaderShadowMapEngineDataTransitPtr
createDependent (BitVector bFlags
);
248 /*---------------------------------------------------------------------*/
252 virtual FieldContainerTransitPtr
shallowCopy (void) const;
253 virtual FieldContainerTransitPtr
shallowCopyLocal(
254 BitVector bFlags
= FCLocal::All
) const;
255 virtual FieldContainerTransitPtr
shallowCopyDependent(
256 BitVector bFlags
) const;
259 /*========================= PROTECTED ===============================*/
263 static TypeObject _type
;
265 static void classDescInserter(TypeObject
&oType
);
266 static const Char8
*getClassname (void );
268 /*---------------------------------------------------------------------*/
272 MFUnrecFrameBufferObjectPtr _mfRenderTargets
;
273 MFUnrecTextureBufferPtr _mfShadowTexBuffers
;
274 SFUnrecTextureObjChunkPtr _sfShadowTexChunk
;
275 SFUnrecImagePtr _sfShadowTexImage
;
276 MFUnrecChunkMaterialPtr _mfLightPassMaterials
;
277 SFUnrecBackgroundPtr _sfBackground
;
280 /*---------------------------------------------------------------------*/
281 /*! \name Constructors */
284 ShaderShadowMapEngineDataBase(void);
285 ShaderShadowMapEngineDataBase(const ShaderShadowMapEngineDataBase
&source
);
288 /*---------------------------------------------------------------------*/
289 /*! \name Destructors */
292 virtual ~ShaderShadowMapEngineDataBase(void);
295 /*---------------------------------------------------------------------*/
296 /*! \name onCreate */
299 void onCreate(const ShaderShadowMapEngineData
*source
= NULL
);
302 /*---------------------------------------------------------------------*/
303 /*! \name Generic Field Access */
306 GetFieldHandlePtr
getHandleRenderTargets (void) const;
307 EditFieldHandlePtr
editHandleRenderTargets (void);
308 GetFieldHandlePtr
getHandleShadowTexBuffers (void) const;
309 EditFieldHandlePtr
editHandleShadowTexBuffers(void);
310 GetFieldHandlePtr
getHandleShadowTexChunk (void) const;
311 EditFieldHandlePtr
editHandleShadowTexChunk (void);
312 GetFieldHandlePtr
getHandleShadowTexImage (void) const;
313 EditFieldHandlePtr
editHandleShadowTexImage (void);
314 GetFieldHandlePtr
getHandleLightPassMaterials (void) const;
315 EditFieldHandlePtr
editHandleLightPassMaterials(void);
316 GetFieldHandlePtr
getHandleBackground (void) const;
317 EditFieldHandlePtr
editHandleBackground (void);
320 /*---------------------------------------------------------------------*/
324 #ifdef OSG_MT_CPTR_ASPECT
325 virtual void execSyncV( FieldContainer
&oFrom
,
326 ConstFieldMaskArg whichField
,
327 AspectOffsetStore
&oOffsets
,
328 ConstFieldMaskArg syncMode
,
329 const UInt32 uiSyncInfo
);
331 void execSync ( ShaderShadowMapEngineDataBase
*pFrom
,
332 ConstFieldMaskArg whichField
,
333 AspectOffsetStore
&oOffsets
,
334 ConstFieldMaskArg syncMode
,
335 const UInt32 uiSyncInfo
);
339 /*---------------------------------------------------------------------*/
344 /*---------------------------------------------------------------------*/
345 /*! \name Aspect Create */
348 #ifdef OSG_MT_CPTR_ASPECT
349 virtual FieldContainer
*createAspectCopy(
350 const FieldContainer
*pRefAspect
) const;
354 /*---------------------------------------------------------------------*/
358 /*---------------------------------------------------------------------*/
362 virtual void resolveLinks(void);
365 /*========================== PRIVATE ================================*/
368 /*---------------------------------------------------------------------*/
370 // prohibit default functions (move to 'public' if you need one)
371 void operator =(const ShaderShadowMapEngineDataBase
&source
);
374 typedef ShaderShadowMapEngineDataBase
*ShaderShadowMapEngineDataBaseP
;
378 #endif /* _OSGSHADERSHADOWMAPENGINEDATABASE_H_ */