changed: gcc8 base update
[opensg.git] / Source / System / NodeCores / Groups / Light / Shadow / Engines / OSGSimpleShadowMapEngine.h
blob4db0f71385fb63a7a98be0f4a2fd9829f67eb4fa
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 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 #ifndef _OSGSIMPLESHADOWMAPENGINE_H_
40 #define _OSGSIMPLESHADOWMAPENGINE_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGConfig.h"
46 #include "OSGSimpleShadowMapEngineBase.h"
48 #include "OSGSimpleShadowMapEngineData.h"
50 #include "OSGDirectionalLight.h"
51 #include "OSGPointLight.h"
53 OSG_BEGIN_NAMESPACE
55 /*! \brief ShadowEngine is the basic NodeCore for inner nodes in the tree.
56 \ingroup GrpGroupLightShadowEnginesObj
57 \ingroup GrpLibOSGGroup
58 \includebasedoc
61 class OSG_GROUP_DLLMAPPING SimpleShadowMapEngine :
62 public SimpleShadowMapEngineBase
64 /*========================== PUBLIC =================================*/
66 public:
68 typedef SimpleShadowMapEngineData EngineData;
69 typedef SimpleShadowMapEngineData *EngineDataPtr;
70 typedef SimpleShadowMapEngineDataUnrecPtr EngineDataUnrecPtr;
72 /*---------------------------------------------------------------------*/
73 /*! \name Sync */
74 /*! \{ */
76 virtual void changed(ConstFieldMaskArg whichField,
77 UInt32 origin,
78 BitVector detail);
80 /*! \} */
81 /*---------------------------------------------------------------------*/
82 /*! \name Render */
83 /*! \{ */
85 virtual Action::ResultE runOnEnter(Light *pLight,
86 LightTypeE eType,
87 RenderAction *pAction);
88 virtual Action::ResultE runOnLeave(Light *pLight,
89 LightTypeE eType,
90 RenderAction *pAction);
92 /*! \} */
93 /*---------------------------------------------------------------------*/
94 /*! \name Helper */
95 /*! \{ */
97 /*! \} */
98 /*---------------------------------------------------------------------*/
99 /*! \name Dump */
100 /*! \{ */
102 virtual void dump( UInt32 uiIndent = 0,
103 const BitVector bvFlags = 0) const;
105 /*! \} */
106 /*========================= PROTECTED ===============================*/
108 protected:
110 typedef SimpleShadowMapEngineBase Inherited;
112 /*---------------------------------------------------------------------*/
113 /*! \name Constructors */
114 /*! \{ */
116 SimpleShadowMapEngine(void);
117 SimpleShadowMapEngine(const SimpleShadowMapEngine &source);
119 /*! \} */
120 /*---------------------------------------------------------------------*/
121 /*! \name Destructors */
122 /*! \{ */
124 virtual ~SimpleShadowMapEngine(void);
126 /*! \} */
127 /*---------------------------------------------------------------------*/
128 /*! \name Init */
129 /*! \{ */
131 static void initMethod(InitPhase ePhase);
133 /*! \} */
134 /*---------------------------------------------------------------------*/
135 /*! \name Action Callbacks */
136 /*! \{ */
138 void lightRenderEnter(Light *pLight,
139 RenderAction *pAction);
141 void setupCamera (Light *pLight,
142 LightTypeE eType,
143 RenderAction *pAction,
144 EngineDataPtr pEngineData);
145 void setupLightChunk (Light *pLight,
146 LightTypeE eType,
147 RenderAction *pAction,
148 EngineDataPtr pEngineData);
150 void doLightPass (Light *pLight,
151 RenderAction *pAction,
152 EngineDataPtr pEngineData);
153 void doAmbientPass (Light *pLight,
154 RenderAction *pAction,
155 EngineDataPtr pEngineData);
156 void doFinalPass (Light *pLight,
157 RenderAction *pAction,
158 EngineDataPtr pEngineData);
160 /*! \} */
161 /*========================== PRIVATE ================================*/
163 private:
165 friend class FieldContainer;
166 friend class SimpleShadowMapEngineBase;
168 /*---------------------------------------------------------------------*/
170 /*!\brief prohibit default function (move to 'public' if needed) */
171 void operator =(const SimpleShadowMapEngine &source);
174 typedef SimpleShadowMapEngine *SimpleShadowMapEngineP;
176 OSG_END_NAMESPACE
178 #include "OSGSimpleShadowMapEngineBase.inl"
179 #include "OSGSimpleShadowMapEngine.inl"
181 #endif /* _OSGSIMPLESHADOWMAPENGINE_H_ */