changed: gcc8 base update
[opensg.git] / Source / System / FileIO / Collada / OSGColladaLight.h
blob74bb12429f603f29a144682410125c7d4be9025a
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2010 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 _OSGCOLLADALIGHT_H_
40 #define _OSGCOLLADALIGHT_H_
42 #include "OSGConfig.h"
44 #ifdef OSG_WITH_COLLADA
46 #include "OSGColladaInstantiableElement.h"
47 #include "OSGColladaElementFactoryHelper.h"
48 #include "OSGColladaInstInfo.h"
49 #include "OSGLightModelChunk.h"
51 #include <dom/domLight.h>
52 #include <dom/domTechnique.h>
54 OSG_BEGIN_NAMESPACE
56 // forward decl
57 class ColladaInstanceLight;
58 class ColladaLight;
59 OSG_GEN_MEMOBJPTR(ColladaLight);
62 class OSG_FILEIO_DLLMAPPING ColladaLight : public ColladaInstantiableElement
64 /*========================== PUBLIC =================================*/
65 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Types */
68 /*! \{ */
70 typedef ColladaInstantiableElement Inherited;
71 typedef ColladaLight Self;
73 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaLight);
75 // forward decl
76 class ColladaLightInstInfo;
77 OSG_GEN_MEMOBJPTR(ColladaLightInstInfo);
80 class ColladaLightInstInfo : public ColladaInstInfo
82 /*========================== PUBLIC =============================*/
83 public:
84 /*-----------------------------------------------------------------*/
85 /*! \name Types */
86 /*! \{ */
88 typedef ColladaInstInfo Inherited;
89 typedef ColladaLightInstInfo Self;
91 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaLightInstInfo);
93 /*! \} */
94 /*-----------------------------------------------------------------*/
95 /*! \name Create */
96 /*! \{ */
98 static ColladaInstInfoTransitPtr
99 create(ColladaElement *colInstParent,
100 ColladaInstanceLight *colInst,
101 Node *beaconN );
103 /*! \} */
104 /*-----------------------------------------------------------------*/
105 /*! \name Process */
106 /*! \{ */
108 virtual void process(void);
110 /*! \} */
111 /*-----------------------------------------------------------------*/
112 /*! \name Access */
113 /*! \{ */
115 Node *getBeacon(void) const;
117 /*! \} */
118 /*========================= PROTECTED ===========================*/
119 protected:
120 /*-----------------------------------------------------------------*/
121 /*! \name Constructors/Destructor */
122 /*! \{ */
124 ColladaLightInstInfo(
125 ColladaElement *colInstParent,
126 ColladaInstanceLight *colInst,
127 Node *beaconN );
128 virtual ~ColladaLightInstInfo(void );
130 /*! \} */
131 /*-----------------------------------------------------------------*/
133 Node *_beacon;
135 private:
137 ColladaLightInstInfo(const ColladaLightInstInfo &other);
138 void operator=(const ColladaLightInstInfo &rhs);
141 // forward decl
142 class ColladaLightAmbientInstInfo;
143 OSG_GEN_MEMOBJPTR(ColladaLightAmbientInstInfo);
145 class ColladaLightAmbientInstInfo : public ColladaInstInfo
147 /*========================== PUBLIC =============================*/
148 public:
149 /*-----------------------------------------------------------------*/
150 /*! \name Types */
151 /*! \{ */
153 typedef ColladaInstInfo Inherited;
154 typedef ColladaLightAmbientInstInfo Self;
156 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaLightAmbientInstInfo);
158 /*! \} */
159 /*-----------------------------------------------------------------*/
160 /*! \name Create */
161 /*! \{ */
163 static ColladaInstInfoTransitPtr
164 create(ColladaElement *colInstParent,
165 ColladaInstanceLight *colInst );
167 /*! \} */
168 /*-----------------------------------------------------------------*/
169 /*! \name Process */
170 /*! \{ */
172 virtual void process(void);
174 /*! \} */
175 /*========================= PROTECTED ===========================*/
176 protected:
177 /*-----------------------------------------------------------------*/
178 /*! \name Constructors/Destructor */
179 /*! \{ */
181 ColladaLightAmbientInstInfo(
182 ColladaElement *colInstParent,
183 ColladaInstanceLight *colInst );
184 virtual ~ColladaLightAmbientInstInfo(void );
186 /*! \} */
187 /*-----------------------------------------------------------------*/
190 /*! \} */
191 /*---------------------------------------------------------------------*/
192 /*! \name Create */
193 /*! \{ */
195 static ColladaElementTransitPtr
196 create(daeElement *elem, ColladaGlobal *global);
198 /*! \} */
199 /*---------------------------------------------------------------------*/
200 /*! \name Reading */
201 /*! \{ */
203 virtual void read (ColladaElement *colElemParent);
204 virtual Node *createInstance(ColladaInstInfo *colInstInfo );
206 /*! \} */
207 /*---------------------------------------------------------------------*/
208 /*! \name Ambient Light */
209 /*! \{ */
211 void createAmbientLight(ColladaLightAmbientInstInfo *colInstInfo);
213 /*! \} */
214 /*========================= PROTECTED ===============================*/
215 protected:
216 /*---------------------------------------------------------------------*/
217 /*! \name Types */
218 /*! \{ */
220 // forward decl
221 class LightLoaderState;
222 OSG_GEN_MEMOBJPTR(LightLoaderState);
225 class LightLoaderState : public ColladaLoaderState
227 /*========================== PUBLIC =============================*/
228 public:
229 /*-----------------------------------------------------------------*/
230 /*! \name Types */
231 /*! \{ */
233 typedef ColladaLoaderState Inherited;
234 typedef LightLoaderState Self;
236 OSG_GEN_INTERNAL_MEMOBJPTR(LightLoaderState);
238 /*! \} */
239 /*-----------------------------------------------------------------*/
240 /*! \name Create */
241 /*! \{ */
243 static LightLoaderStateTransitPtr create(void);
245 /*! \} */
246 /*-----------------------------------------------------------------*/
247 /*! \name Access */
248 /*! \{ */
250 LightModelChunk *getLightModelChunk(void ) const;
251 void setLightModelChunk(LightModelChunk *chunk);
253 /*! \} */
254 /*========================= PROTECTED ===========================*/
255 protected:
256 /*-----------------------------------------------------------------*/
257 /*! \name Constructors/Destructor */
258 /*! \{ */
260 LightLoaderState(void);
261 virtual ~LightLoaderState(void);
263 /*! \} */
264 /*-----------------------------------------------------------------*/
266 LightModelChunkUnrecPtr _lightModel;
269 /*! \} */
270 /*---------------------------------------------------------------------*/
271 /*! \name Constructors/Destructor */
272 /*! \{ */
274 ColladaLight(daeElement *elem,
275 ColladaGlobal *global);
276 virtual ~ColladaLight(void );
278 /*! \} */
279 /*---------------------------------------------------------------------*/
280 /*! \name Helper Functions */
281 /*! \{ */
283 Node *createInstanceTechnique(ColladaLightInstInfo *colInstInfo,
284 domTechnique *tech );
285 Node *createInstanceCommon (ColladaLightInstInfo *colInstInfo,
286 domLight::domTechnique_common *tech );
288 /*! \} */
289 /*---------------------------------------------------------------------*/
291 static ColladaElementRegistrationHelper _regHelper;
292 static const std::string _loaderStateName;
295 OSG_END_NAMESPACE
297 // #include "OSGColladaLight.inl"
299 #endif // OSG_WITH_COLLADA
301 #endif // _OSGCOLLADALIGHT_H_