changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Groups / Light / Shadow / Engines / OSGShaderShadowMapEngineBase.h
blob2c9c119add964e284b247512ca6b60ca816c3edb
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2013 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, carsten_neumann@gmx.net *
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 ShaderShadowMapEngine
49 ** **
50 *****************************************************************************
51 \*****************************************************************************/
54 #ifndef _OSGSHADERSHADOWMAPENGINEBASE_H_
55 #define _OSGSHADERSHADOWMAPENGINEBASE_H_
56 #ifdef __sgi
57 #pragma once
58 #endif
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"
73 OSG_BEGIN_NAMESPACE
76 class ShaderShadowMapEngine;
78 //! \brief ShaderShadowMapEngine Base Class.
80 class OSG_GROUP_DLLMAPPING ShaderShadowMapEngineBase : public ShadowMapEngine
82 public:
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 =================================*/
94 public:
96 enum
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 */
127 /*! \{ */
129 static FieldContainerType &getClassType (void);
130 static UInt32 getClassTypeId (void);
131 static UInt16 getClassGroupId(void);
133 /*! \} */
134 /*---------------------------------------------------------------------*/
135 /*! \name FieldContainer Get */
136 /*! \{ */
138 virtual FieldContainerType &getType (void);
139 virtual const FieldContainerType &getType (void) const;
141 virtual UInt32 getContainerSize(void) const;
143 /*! \} */
144 /*---------------------------------------------------------------------*/
145 /*! \name Field Get */
146 /*! \{ */
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;
176 /*! \} */
177 /*---------------------------------------------------------------------*/
178 /*! \name Field Set */
179 /*! \{ */
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);
187 /*! \} */
188 /*---------------------------------------------------------------------*/
189 /*! \name Ptr Field Set */
190 /*! \{ */
192 /*! \} */
193 /*---------------------------------------------------------------------*/
194 /*! \name Ptr MField Set */
195 /*! \{ */
197 /*! \} */
198 /*---------------------------------------------------------------------*/
199 /*! \name Binary Access */
200 /*! \{ */
202 virtual SizeT getBinSize (ConstFieldMaskArg whichField);
203 virtual void copyToBin (BinaryDataHandler &pMem,
204 ConstFieldMaskArg whichField);
205 virtual void copyFromBin(BinaryDataHandler &pMem,
206 ConstFieldMaskArg whichField);
209 /*! \} */
210 /*---------------------------------------------------------------------*/
211 /*! \name Construction */
212 /*! \{ */
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);
225 /*! \} */
226 /*---------------------------------------------------------------------*/
227 /*! \name Copy */
228 /*! \{ */
230 virtual FieldContainerTransitPtr shallowCopy (void) const;
231 virtual FieldContainerTransitPtr shallowCopyLocal(
232 BitVector bFlags = FCLocal::All) const;
233 virtual FieldContainerTransitPtr shallowCopyDependent(
234 BitVector bFlags) const;
236 /*! \} */
237 /*========================= PROTECTED ===============================*/
239 protected:
241 static TypeObject _type;
243 static void classDescInserter(TypeObject &oType);
244 static const Char8 *getClassname (void );
246 /*---------------------------------------------------------------------*/
247 /*! \name Fields */
248 /*! \{ */
250 SFUnrecShaderProgramPtr _sfShadowVertexProgram;
251 SFUnrecShaderProgramPtr _sfShadowFragmentProgram;
252 SFInt32 _sfForceTextureUnit;
253 SFReal32 _sfShadowNear;
254 SFReal32 _sfShadowFar;
256 /*! \} */
257 /*---------------------------------------------------------------------*/
258 /*! \name Constructors */
259 /*! \{ */
261 ShaderShadowMapEngineBase(void);
262 ShaderShadowMapEngineBase(const ShaderShadowMapEngineBase &source);
264 /*! \} */
265 /*---------------------------------------------------------------------*/
266 /*! \name Destructors */
267 /*! \{ */
269 virtual ~ShaderShadowMapEngineBase(void);
271 /*! \} */
272 /*---------------------------------------------------------------------*/
273 /*! \name onCreate */
274 /*! \{ */
276 void onCreate(const ShaderShadowMapEngine *source = NULL);
278 /*! \} */
279 /*---------------------------------------------------------------------*/
280 /*! \name Generic Field Access */
281 /*! \{ */
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);
294 /*! \} */
295 /*---------------------------------------------------------------------*/
296 /*! \name Sync */
297 /*! \{ */
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);
311 #endif
313 /*! \} */
314 /*---------------------------------------------------------------------*/
315 /*! \name Edit */
316 /*! \{ */
318 /*! \} */
319 /*---------------------------------------------------------------------*/
320 /*! \name Aspect Create */
321 /*! \{ */
323 #ifdef OSG_MT_CPTR_ASPECT
324 virtual FieldContainer *createAspectCopy(
325 const FieldContainer *pRefAspect) const;
326 #endif
328 /*! \} */
329 /*---------------------------------------------------------------------*/
330 /*! \name Edit */
331 /*! \{ */
332 /*! \} */
333 /*---------------------------------------------------------------------*/
334 /*! \name Sync */
335 /*! \{ */
337 virtual void resolveLinks(void);
339 /*! \} */
340 /*========================== PRIVATE ================================*/
342 private:
343 /*---------------------------------------------------------------------*/
345 // prohibit default functions (move to 'public' if you need one)
346 void operator =(const ShaderShadowMapEngineBase &source);
349 typedef ShaderShadowMapEngineBase *ShaderShadowMapEngineBaseP;
351 OSG_END_NAMESPACE
353 #endif /* _OSGSHADERSHADOWMAPENGINEBASE_H_ */