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 ShaderShadowMapEngine
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADERSHADOWMAPENGINEBASE_H_
55 #define _OSGSHADERSHADOWMAPENGINEBASE_H_
61 #include "OSGConfig.h"
62 #include "OSGGroupDef.h"
64 //#include "OSGBaseTypes.h"
66 #include "OSGShadowMapEngine.h" // Parent
68 #include "OSGShaderProgramFields.h" // ShadowVertexProgram type
69 #include "OSGSysFields.h" // ForceTextureUnit type
71 #include "OSGShaderShadowMapEngineFields.h"
76 class ShaderShadowMapEngine
;
78 //! \brief ShaderShadowMapEngine Base Class.
80 class OSG_GROUP_DLLMAPPING ShaderShadowMapEngineBase
: public ShadowMapEngine
84 typedef ShadowMapEngine Inherited
;
85 typedef ShadowMapEngine ParentContainer
;
87 typedef Inherited::TypeObject TypeObject
;
88 typedef TypeObject::InitPhase InitPhase
;
90 OSG_GEN_INTERNALPTR(ShaderShadowMapEngine
);
92 /*========================== PUBLIC =================================*/
98 ShadowVertexProgramFieldId
= Inherited::NextFieldId
,
99 ShadowFragmentProgramFieldId
= ShadowVertexProgramFieldId
+ 1,
100 ForceTextureUnitFieldId
= ShadowFragmentProgramFieldId
+ 1,
101 ShadowNearFieldId
= ForceTextureUnitFieldId
+ 1,
102 ShadowFarFieldId
= ShadowNearFieldId
+ 1,
103 NextFieldId
= ShadowFarFieldId
+ 1
106 static const OSG::BitVector ShadowVertexProgramFieldMask
=
107 (TypeTraits
<BitVector
>::One
<< ShadowVertexProgramFieldId
);
108 static const OSG::BitVector ShadowFragmentProgramFieldMask
=
109 (TypeTraits
<BitVector
>::One
<< ShadowFragmentProgramFieldId
);
110 static const OSG::BitVector ForceTextureUnitFieldMask
=
111 (TypeTraits
<BitVector
>::One
<< ForceTextureUnitFieldId
);
112 static const OSG::BitVector ShadowNearFieldMask
=
113 (TypeTraits
<BitVector
>::One
<< ShadowNearFieldId
);
114 static const OSG::BitVector ShadowFarFieldMask
=
115 (TypeTraits
<BitVector
>::One
<< ShadowFarFieldId
);
116 static const OSG::BitVector NextFieldMask
=
117 (TypeTraits
<BitVector
>::One
<< NextFieldId
);
119 typedef SFUnrecShaderProgramPtr SFShadowVertexProgramType
;
120 typedef SFUnrecShaderProgramPtr SFShadowFragmentProgramType
;
121 typedef SFInt32 SFForceTextureUnitType
;
122 typedef SFReal32 SFShadowNearType
;
123 typedef SFReal32 SFShadowFarType
;
125 /*---------------------------------------------------------------------*/
126 /*! \name Class Get */
129 static FieldContainerType
&getClassType (void);
130 static UInt32
getClassTypeId (void);
131 static UInt16
getClassGroupId(void);
134 /*---------------------------------------------------------------------*/
135 /*! \name FieldContainer Get */
138 virtual FieldContainerType
&getType (void);
139 virtual const FieldContainerType
&getType (void) const;
141 virtual UInt32
getContainerSize(void) const;
144 /*---------------------------------------------------------------------*/
145 /*! \name Field Get */
148 const SFUnrecShaderProgramPtr
*getSFShadowVertexProgram(void) const;
149 SFUnrecShaderProgramPtr
*editSFShadowVertexProgram(void);
150 const SFUnrecShaderProgramPtr
*getSFShadowFragmentProgram(void) const;
151 SFUnrecShaderProgramPtr
*editSFShadowFragmentProgram(void);
153 SFInt32
*editSFForceTextureUnit(void);
154 const SFInt32
*getSFForceTextureUnit (void) const;
156 SFReal32
*editSFShadowNear (void);
157 const SFReal32
*getSFShadowNear (void) const;
159 SFReal32
*editSFShadowFar (void);
160 const SFReal32
*getSFShadowFar (void) const;
163 ShaderProgram
* getShadowVertexProgram(void) const;
165 ShaderProgram
* getShadowFragmentProgram(void) const;
167 Int32
&editForceTextureUnit(void);
168 Int32
getForceTextureUnit (void) const;
170 Real32
&editShadowNear (void);
171 Real32
getShadowNear (void) const;
173 Real32
&editShadowFar (void);
174 Real32
getShadowFar (void) const;
177 /*---------------------------------------------------------------------*/
178 /*! \name Field Set */
181 void setShadowVertexProgram(ShaderProgram
* const value
);
182 void setShadowFragmentProgram(ShaderProgram
* const value
);
183 void setForceTextureUnit(const Int32 value
);
184 void setShadowNear (const Real32 value
);
185 void setShadowFar (const Real32 value
);
188 /*---------------------------------------------------------------------*/
189 /*! \name Ptr Field Set */
193 /*---------------------------------------------------------------------*/
194 /*! \name Ptr MField Set */
198 /*---------------------------------------------------------------------*/
199 /*! \name Binary Access */
202 virtual SizeT
getBinSize (ConstFieldMaskArg whichField
);
203 virtual void copyToBin (BinaryDataHandler
&pMem
,
204 ConstFieldMaskArg whichField
);
205 virtual void copyFromBin(BinaryDataHandler
&pMem
,
206 ConstFieldMaskArg whichField
);
210 /*---------------------------------------------------------------------*/
211 /*! \name Construction */
214 static ShaderShadowMapEngineTransitPtr
create (void);
215 static ShaderShadowMapEngine
*createEmpty (void);
217 static ShaderShadowMapEngineTransitPtr
createLocal (
218 BitVector bFlags
= FCLocal::All
);
220 static ShaderShadowMapEngine
*createEmptyLocal(
221 BitVector bFlags
= FCLocal::All
);
223 static ShaderShadowMapEngineTransitPtr
createDependent (BitVector bFlags
);
226 /*---------------------------------------------------------------------*/
230 virtual FieldContainerTransitPtr
shallowCopy (void) const;
231 virtual FieldContainerTransitPtr
shallowCopyLocal(
232 BitVector bFlags
= FCLocal::All
) const;
233 virtual FieldContainerTransitPtr
shallowCopyDependent(
234 BitVector bFlags
) const;
237 /*========================= PROTECTED ===============================*/
241 static TypeObject _type
;
243 static void classDescInserter(TypeObject
&oType
);
244 static const Char8
*getClassname (void );
246 /*---------------------------------------------------------------------*/
250 SFUnrecShaderProgramPtr _sfShadowVertexProgram
;
251 SFUnrecShaderProgramPtr _sfShadowFragmentProgram
;
252 SFInt32 _sfForceTextureUnit
;
253 SFReal32 _sfShadowNear
;
254 SFReal32 _sfShadowFar
;
257 /*---------------------------------------------------------------------*/
258 /*! \name Constructors */
261 ShaderShadowMapEngineBase(void);
262 ShaderShadowMapEngineBase(const ShaderShadowMapEngineBase
&source
);
265 /*---------------------------------------------------------------------*/
266 /*! \name Destructors */
269 virtual ~ShaderShadowMapEngineBase(void);
272 /*---------------------------------------------------------------------*/
273 /*! \name onCreate */
276 void onCreate(const ShaderShadowMapEngine
*source
= NULL
);
279 /*---------------------------------------------------------------------*/
280 /*! \name Generic Field Access */
283 GetFieldHandlePtr
getHandleShadowVertexProgram (void) const;
284 EditFieldHandlePtr
editHandleShadowVertexProgram(void);
285 GetFieldHandlePtr
getHandleShadowFragmentProgram (void) const;
286 EditFieldHandlePtr
editHandleShadowFragmentProgram(void);
287 GetFieldHandlePtr
getHandleForceTextureUnit (void) const;
288 EditFieldHandlePtr
editHandleForceTextureUnit(void);
289 GetFieldHandlePtr
getHandleShadowNear (void) const;
290 EditFieldHandlePtr
editHandleShadowNear (void);
291 GetFieldHandlePtr
getHandleShadowFar (void) const;
292 EditFieldHandlePtr
editHandleShadowFar (void);
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 ( ShaderShadowMapEngineBase
*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 ShaderShadowMapEngineBase
&source
);
349 typedef ShaderShadowMapEngineBase
*ShaderShadowMapEngineBaseP
;
353 #endif /* _OSGSHADERSHADOWMAPENGINEBASE_H_ */