2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FUiEffects_RuntimeRenderDataScene.h
19 * @brief This is the header file for the render structures for all scene (for EffectModel instance entire)
22 #ifndef _FUI_EFFECTS_INTERNAL_RUNTIME_RENDER_DATA_SCENE_H_
23 #define _FUI_EFFECTS_INTERNAL_RUNTIME_RENDER_DATA_SCENE_H_
25 #include <unique_ptr.h>
31 #include <utils/FUiEffects_Utils.h>
32 #include <FUiEffects_RuntimePropertyCast.h>
33 #include <FUiEffects_RuntimeModel.h>
34 #include <FUiEffects_RuntimeRenderDataSurface.h>
36 namespace Tizen { namespace Ui { namespace Effects { namespace _Runtime
46 * Adds specified unit light into scene
50 * @remarks For using in lua also
53 bool AddUnitLight(UnitLight& unitLight);
56 * Excludes specified unit light from scene with using unique unit light name
60 * @remarks For using in lua also
63 bool RemoveUnitLight(const std::string& name);
66 * Excludes all units light of specified type from scene
70 * @remarks For using in lua also
73 bool RemoveAllUnitsLightType(TypeUnitLight typeUnitLight);
76 * Returns specified unit light to a client with using unique unit light name
80 * @remarks For using in lua also
83 PropertyCast GetUnitLight(const std::string& name) const;
86 * Sets ambient colour for entire scene
90 * @remarks For using in lua also
93 void SetLightAmbientColour(const Tizen::Ui::Effects::_Utils::Vec3f& ambientColour);
96 * Sets ambient colour for entire scene
100 * @remarks For using in lua also
103 void SetLightAmbientColour(float red, float green, float blue);
106 * Sets light intensity for entire scene
110 * @remarks For using in lua also
113 void SetLightIntensity(float intensity);
116 * Sets attenuation for units light as environment variable (How far does unit light can light?)
120 * @remarks For using in lua also
123 void SetLightAttenuation(float attenuation);
126 * Returns attenuation for units light as environment variable
130 * @remarks For using in lua also
133 const Tizen::Ui::Effects::_Utils::Vec3f& GetLightAmbientColour(void) const;
136 * Returns intensity for units light as environment variable
140 * @remarks For using in lua also
143 float GetLightIntensity(void) const;
146 * Returns attenuation for units light as environment variable
150 * @remarks For using in lua also
153 float GetLightAttenuation(void) const;
156 * Returns size of units light container
160 * @remarks For working with units light collection
163 long GetSizeUnitLightContainer(void) const;
166 * Returns type of current units light from units light container
170 * @remarks For working with units light collection
173 TypeUnitLight GetTypeOfCurrentUnitLight(void) const;
176 * Returns a pointer to current units light from units light container
180 * @remarks For working with units light collection
183 template<class T> const T* GetCurrentUnitLight(void) const;
186 * Assignments next value for internal iterator for access to next unit light in units light container
190 * @remarks For working with units light collection
191 * Returns true if transition was succeeded and false otherwise
194 bool GoToNextUnitLight(void);
197 * Locks units light container for future work with units light from it
201 * @remarks For working with units light collection
202 * Return true if the locking was succeeded and false otherwise
203 * Without performing this function client can not performs any action on units light from units light container
206 bool LockUnitsLightContainer(void);
209 * Unlocks units light container with purpose to prohibit any future actions on units light container
213 * @remarks For working with units light collection
214 * This function calls automatically when client adds or removes some unit light from scene
217 void UnlockUnitsLightContainer(void);
220 * Returns true if units light container is locked and false otherwise
224 * @remarks For working with units light collection
227 bool GetIsLockedUnitsLightContainer(void) const;
230 * Resets all signs for current unit light (e.g. isIntensityChanged, isColourChanged)
235 bool ResetSignsCurrentUnitLight(void);
238 * Returns a reference to collection of render data for each graphical surface
243 RenderDataSurfaceCollection& GetRenderDataSurfaceCollection(void);
253 RenderDataScene(void);
261 ~RenderDataScene(void);
263 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
264 RenderDataScene(const RenderDataScene& rhs);
265 // The implementation of this assignment operator is intentionally blank and declared as private to prohibit copying of objects.
266 RenderDataScene& operator=(const RenderDataScene& rhs);
269 * For internal purposes only
274 template<class T> const T* GetCurrentUnitLightInternal(void) const;
277 * For internal purposes only
282 PropertyCast GetConcreteUnitLight(const UnitLight& unitLight) const;
285 * For internal purposes only
290 void RemoveUnitLight(UnitLight& unitLight);
294 bool isAmbientColourChanged;
295 bool isIntensityChanged;
296 bool isAttenuationChanged;
297 bool isSomethingChanged;
301 typedef std::map<std::string, UnitLight*> UnitLightNameTree;
302 typedef std::list<UnitLight*> UnitLightCollection;
304 RenderDataSurfaceCollection __renderDataSurfaceCollection; /**< a container of pointers to graphical surfaces render data*/
306 UnitLightCollection __unitsLight; /**< units light container*/
307 UnitLightCollection::iterator __iteratorCurrentUnitLight; /**< an iterator to point to current units light*/
308 bool __isLockedUnitsLightContainer; /**< is units light container locked or not*/
310 UnitLightNameTree __unitLightNameTree; /*< a map for quick search need unit light with using a name of it */
312 Tizen::Ui::Effects::_Utils::Vec3f __ambientColour; /**< ambient colour*/
313 float __intensity; /**< intensity for units light as environment variable*/
314 float __attenuation; /**< attenuation for units light as environment variable (this variable has no influence on directionals light)*/
316 friend class EffectModel; //for building the container __renderDataSurfaceCollection
317 friend class boost::default_delete<RenderDataScene>;//for deleting RenderDataScene instance
320 } } } } // Tizen::Ui::Effects::_Runtime
322 #endif // _FUI_EFFECTS_INTERNAL_RUNTIME_RENDER_DATA_SCENE_H_