Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / effects / runtime / FUiEffects_RuntimeEffectModel.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17 /**
18  * @file        FUiEffects_RuntimeEffectModel.cpp
19  * @brief       This file contains an implementation of EffectModel class methods
20  *
21  */
22
23 #include <memory>
24 #include <FBaseSysLog.h>
25 #include <FBaseErrors.h>
26 #include "../FUiEffects_EffectErrorMessages.h"
27 #include <FUiEffectsTypes.h>
28 #include <FUiEffects_LoggingProfiler.h>
29 #include "FUiEffects_RuntimeEffectModel.h"
30 #include "FUiEffects_RuntimeModelSurface.h"
31 #include "FUiEffects_RuntimeGraphicalSurface.h"
32 #include "FUiEffects_RuntimeRenderDataScene.h"
33
34 using namespace Tizen::Ui::Effects;
35 using namespace Tizen::Ui::Effects::_PhysicsEngine;
36 using namespace Tizen::Ui::Effects::_Utils;
37 using namespace std;
38
39 namespace Tizen { namespace Ui { namespace Effects { namespace _Runtime
40 {
41
42 void
43 ModelSurfacesCollectionDeleter::operator()(TypeMSurfacesCollection* pMSurfacesCollection)
44 {
45         TypeMSurfacesCollection::iterator it;
46         for (it = pMSurfacesCollection->begin(); it != pMSurfacesCollection->end(); ++it)
47         {
48                 delete *it;
49         }
50         delete pMSurfacesCollection;
51 }
52
53 EffectModel::EffectModel(long effectID_,
54                                                  const std::string& name,
55                                                  const char* pPathToScript,
56                                                  IEffectModelListener* pEMListener,
57                                                  EffectType effectType_,
58                                                  TypeTimeEffect effectDuration_)
59                                                         : __pScript(null)
60                                                         , __pEMListener(pEMListener)
61                                                         , __state(_EFFECT_STATE_INITIALIZING)
62                                                         , __effectType(effectType_)
63                                                         , __effectResult()
64                                                         , __pMapElements(null)
65                                                         , __pMapGSurface(null)
66                                                         , __pMSurfacesCollection(null)
67                                                         , __effectID(effectID_)
68                                                         , __name(name)
69                                                         , __effectTimePassed(0)
70                                                         , __effectDuration(effectDuration_)
71                                                         , __pRenderDataScene(null)
72 {
73         __state = _EFFECT_STATE_RUNTIME_ERROR;
74
75         unique_ptr<ScriptProcessing> pScript(new (std::nothrow) ScriptProcessing(pPathToScript, this));
76         SysTryReturnVoidResult(NID_UI_EFFECT, pScript.get() != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
77         result res = GetLastResult();
78         SysTryReturnVoidResult(NID_UI_EFFECT, res == E_SUCCESS, res, GetErrorMessage(res));
79
80         unique_ptr<TypeMSurfacesCollection, ModelSurfacesCollectionDeleter> pMSurfacesCollection(new (std::nothrow) TypeMSurfacesCollection, ModelSurfacesCollectionDeleter());
81         SysTryReturnVoidResult(NID_UI_EFFECT, pMSurfacesCollection.get() != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
82
83         unique_ptr<TypeMapElements> pMapElements(new (std::nothrow) TypeMapElements);
84         SysTryReturnVoidResult(NID_UI_EFFECT, pMapElements.get() != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
85
86         unique_ptr<TypeMapGSurface> pMapGSurface(new (std::nothrow) TypeMapGSurface);
87         SysTryReturnVoidResult(NID_UI_EFFECT, pMapGSurface.get() != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
88
89         unique_ptr<RenderDataScene> pRenderDataScene(new (std::nothrow) RenderDataScene());
90         SysTryReturnVoidResult(NID_UI_EFFECT, pRenderDataScene.get() != null, E_OUT_OF_MEMORY, _UiEffectError::OUT_OF_MEMORY);
91
92         __state = _EFFECT_STATE_INITIALIZING;
93
94         __pScript = std::move(pScript);
95         __pMSurfacesCollection = std::move(pMSurfacesCollection);
96         __pMapElements = std::move(pMapElements);
97         __pMapGSurface = std::move(pMapGSurface);
98         __pRenderDataScene = std::move(pRenderDataScene);
99
100         if (pEMListener == null)
101         {
102                 SysLogException(NID_UI_EFFECT, E_SYSTEM, "The pointer to EffectModelListener is null!");
103                 __state = _EFFECT_STATE_RUNTIME_ERROR;
104         }
105 }
106
107 EffectModel::~EffectModel(void)
108 {
109
110 }
111
112 void
113 EffectModel::AddModelSurface(ModelSurface* pMSurface)
114 {
115         if (__state == _EFFECT_STATE_INITIALIZING)
116         {
117                 __pMSurfacesCollection->push_back(pMSurface);
118         }
119         return;
120 }
121
122 inline void
123 EffectModel::EffectInitialize(void)
124 {
125         SysAssertf(__state == _EFFECT_STATE_FINISHING || __state == _EFFECT_STATE_INITIALIZING, _UiEffectError::INTERNAL_ERROR);
126
127         __state = _EFFECT_STATE_INITIALIZING;
128
129         TypeMSurfacesCollection::iterator it;
130         for (it = __pMSurfacesCollection->begin(); it != __pMSurfacesCollection->end(); ++it)
131         {
132                 (*it)->Initialize();
133         }
134
135         InitEffectModel();
136         return;
137 }
138
139 int
140 EffectModel::Start(const EffectsVector<float>& effectStartInfo)
141 {
142         if (__state != _EFFECT_STATE_RUNNABLE)
143         {
144                 return 1;
145         }
146
147         __state = _EFFECT_STATE_STARTING;
148
149         START_PROFILER(EFFLOG_SCRIPT)
150         if (!__pScript->OnEffectStart(effectStartInfo))
151         {
152                 Stop(true, false);
153                 return 2;
154         }
155         END_PROFILER(EFFLOG_SCRIPT)
156
157         //requesting a bitmap for each graphical surface to effect impl
158         RenderDataSurfaceCollection::const_iterator it;
159         for (it = __pRenderDataScene->GetRenderDataSurfaceCollection().begin(); it != __pRenderDataScene->GetRenderDataSurfaceCollection().end(); ++it)
160         {
161                 START_PROFILER(EFFLOG_BITMAP)
162                 if (!__pEMListener->OnBitmapRequested((*it)->bitmapId))
163                 {
164                         Stop(true, false);
165                         return 3;
166                 }
167                 END_PROFILER(EFFLOG_BITMAP)
168         }
169
170         //sending event to effect impl about effect started
171         PROFILER_EXPR(__pEMListener->OnEffectStarted();, EFFLOG_OnEffectStarted);
172
173         __state = _EFFECT_STATE_RUNNING;
174         return 0;
175 }
176
177 void
178 EffectModel::Stop(bool isBreakdown, bool isInterruptedFromApplication)
179 {
180         if (!isBreakdown)
181         {
182                 if (__state != _EFFECT_STATE_RUNNING)
183                 {
184                         return;
185                 }
186
187                 __state = _EFFECT_STATE_FINISHING;
188                 if (isInterruptedFromApplication)
189                 {
190                         __effectResult.effectResult = EFFECT_RESULT_INTERRUPTED;
191                         __effectResult.lastShownBitmapsId = LastShownBitmapIdCollection(1, -1);
192                 }
193                 __pEMListener->OnEffectFinished(__effectResult.effectResult, __effectResult.lastShownBitmapsId);
194                 EffectInitialize();
195         }
196         else
197         {
198                 __state = _EFFECT_STATE_RUNTIME_ERROR;
199                 __effectResult.effectResult = EFFECT_RESULT_ERROR;
200                 __effectResult.lastShownBitmapsId = LastShownBitmapIdCollection(1, -1);
201                 __pEMListener->OnEffectFinished(__effectResult.effectResult, __effectResult.lastShownBitmapsId);
202         }
203         return;
204 }
205
206 void
207 EffectModel::Calculate(float dt)
208 {
209         if (__state != _EFFECT_STATE_RUNNING)
210         {
211                 return;
212         }
213
214         __effectTimePassed += dt;
215         if (__effectTimePassed > __effectDuration && __effectDuration > std::numeric_limits<TypeTimeEffect>::epsilon())
216         {
217                 __effectTimePassed = __effectDuration;
218         }
219
220         START_PROFILER_AV(Calculate_calc_script, 50);
221         if (!__pScript->OnEffectCalculate(dt))
222         {
223                 Stop(true, false);
224                 return;
225         }
226         END_PROFILER_AV(Calculate_calc_script);
227
228         TypeMSurfacesCollection::iterator it;
229         START_PROFILER_AV(Calculate_calc_model, 50);
230         for (it = __pMSurfacesCollection->begin(); it != __pMSurfacesCollection->end(); ++it)
231         {
232                 //physics calculations
233                 (*it)->Calculate(dt);
234         }
235         END_PROFILER_AV(Calculate_calc_model);
236
237         if (__effectType == EFFECT_TYPE_INTERACTIVE)
238         {
239                 __effectResult = __pScript->IsEffectFinished();
240         }
241         else if (__effectTimePassed >= __effectDuration && __effectDuration > std::numeric_limits<TypeTimeEffect>::epsilon())
242         {
243                 __effectResult.effectResult = EFFECT_RESULT_FINISHED;
244                 __effectResult.lastShownBitmapsId = LastShownBitmapIdCollection(1, 1);
245         }
246
247         switch (__effectResult.effectResult)
248         {
249         case EFFECT_RESULT_FINISHED:
250                 Stop(false, false);
251                 break;
252         case EFFECT_RESULT_ERROR:
253                 Stop(true, false);
254                 break;
255         default:
256                 break;
257         }
258         return;
259 }
260
261 void
262 EffectModel::FeedTouchPressEvent(const TouchEventScript &pos3)
263 {
264         SysTryReturnVoidResult(NID_UI_EFFECT, __state == _EFFECT_STATE_RUNNING, E_INVALID_STATE, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
265         SysTryReturnVoidResult(NID_UI_EFFECT, __effectType == EFFECT_TYPE_INTERACTIVE, E_OPERATION_FAILED, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
266
267         if (!__pScript->OnTouchPressed(pos3))
268         {
269                 Stop(true, false);
270                 SysLogException(NID_UI_EFFECT, E_OPERATION_FAILED, "Runtime error in OnEffectsTouchPressed Script for Effect with Id = %i and name \"%s\" is appeared. Effect is blocked!", __effectID, __name.c_str());
271         }
272         return;
273 }
274
275 void
276 EffectModel::FeedTouchMoveEvent(const TouchEventScript &pos3)
277 {
278         SysTryReturnVoidResult(NID_UI_EFFECT, __state == _EFFECT_STATE_RUNNING, E_INVALID_STATE, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
279         SysTryReturnVoidResult(NID_UI_EFFECT, __effectType == EFFECT_TYPE_INTERACTIVE, E_OPERATION_FAILED, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
280
281         if (!__pScript->OnTouchMoved(pos3))
282         {
283                 Stop(true, false);
284                 SysLogException(NID_UI_EFFECT, E_OPERATION_FAILED, "Runtime error in OnEffectsTouchMoved Script for Effect with Id = %i and name \"%s\" is appeared. Effect is blocked!", __effectID, __name.c_str());
285         }
286         return;
287 }
288
289 void
290 EffectModel::FeedTouchReleaseEvent(const TouchEventScript &pos3)
291 {
292         SysTryReturnVoidResult(NID_UI_EFFECT, __state == _EFFECT_STATE_RUNNING, E_INVALID_STATE, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
293         SysTryReturnVoidResult(NID_UI_EFFECT, __effectType == EFFECT_TYPE_INTERACTIVE, E_OPERATION_FAILED, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
294
295         if (!__pScript->OnTouchReleased(pos3))
296         {
297                 Stop(true, false);
298                 SysLogException(NID_UI, E_OPERATION_FAILED, "Runtime error in OnEffectsTouchReleased Script for Effect with Id = %i and name \"%s\" is appeared. Effect is blocked!", __effectID, __name.c_str());
299         }
300         return;
301 }
302
303 void
304 EffectModel::FeedTouchDoublePressEvent(const TouchEventScript &pos3)
305 {
306         SysTryReturnVoidResult(NID_UI_EFFECT, __state == _EFFECT_STATE_RUNNING, E_INVALID_STATE, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
307         SysTryReturnVoidResult(NID_UI_EFFECT, __effectType == EFFECT_TYPE_INTERACTIVE, E_OPERATION_FAILED, _UiEffectError::FEED_TOUCH_IS_BLOCKED, __effectID, __name.c_str());
308
309         if (!__pScript->OnTouchDoublePressed(pos3))
310         {
311                 Stop(true, false);
312                 SysLogException(NID_UI_EFFECT, E_OPERATION_FAILED, "Runtime error in OnEffectsTouchDoublePressed Script for Effect with Id = %i and name \"%s\" is appeared. Effect is blocked!", __effectID, __name.c_str());
313         }
314         return;
315 }
316
317 float
318 EffectModel::GetCalculationPeriodForTimer(void)const
319 {
320         return __effectTimePassed;
321 }
322
323 _EffectState
324 EffectModel::GetState(void)const
325 {
326         return __state;
327 }
328
329 EffectType
330 EffectModel::GetType(void)const
331 {
332         return __effectType;
333 }
334
335 bool
336 EffectModel::ScriptSetProperty(long objID, ElementProperty property, bool value)
337 {
338         TypeMapElements::iterator it;
339         if (!FindElement(objID, it))
340         {
341                 return false;
342         }
343         return it->second->SetProperty(property, value);
344 }
345
346 bool
347 EffectModel::ScriptSetProperty(long objID, ElementProperty property, LUA_NUMBER value)
348 {
349         if (objID == 0)
350         {
351                 bool res = true;
352                 switch (property)
353                 {
354                 case N_EFFECT_DURATION:
355                         __effectDuration = value;
356                         break;
357                 default:
358                         res = false;
359                         break;
360                 }
361                 return res;
362         }
363
364         TypeMapElements::iterator it;
365         if (!FindElement(objID, it))
366         {
367                 return false;
368         }
369         return it->second->SetProperty(property, value);
370 }
371
372 bool
373 EffectModel::ScriptSetProperty(long objID, ElementProperty property, const Vec3f &value)
374 {
375         TypeMapElements::iterator it;
376         if (!FindElement(objID, it))
377         {
378                 return false;
379         }
380         return it->second->SetProperty(property, value);
381 }
382
383 bool
384 EffectModel::ScriptSetPropertyGroup(long modelSurfaceID, GroupElements group, ElementProperty property, LUA_NUMBER value)
385 {
386         TypeMSurfacesCollection::iterator it;
387         for (it = __pMSurfacesCollection->begin(); it != __pMSurfacesCollection->end(); ++it)
388         {
389                 if ((*it)->GetId() == modelSurfaceID)
390                 {
391                         return (*it)->SetPropertyGroup(group, property, value);
392                 }
393         }
394         return false;
395 }
396
397 PropertyCast
398 EffectModel::ScriptGetDistanceFromGround(long modelSurfaceID) const
399 {
400         PropertyCast propCast = {PropertyCast::NO_PROPERTY, {0} };
401         TypeMSurfacesCollection::iterator it;
402         for (it = __pMSurfacesCollection->begin(); it != __pMSurfacesCollection->end(); ++it)
403         {
404                 if ((*it)->GetId() == modelSurfaceID)
405                 {
406                         propCast.type = PropertyCast::NUMBER;
407                         propCast.value.numberValue = (*it)->GetDistanceFromGround();
408                         return propCast;
409                 }
410         }
411         propCast.type = PropertyCast::NO_PROPERTY;
412         return propCast;
413 }
414
415 PropertyCast
416 EffectModel::ScriptGetProperty(long objID, ElementProperty property) const
417 {
418         if (objID == 0)
419         {
420                 PropertyCast propCast = {PropertyCast::NO_PROPERTY, {0}};
421                 switch (property)
422                 {
423                 case N_EFFECT_TIME_PASSED:
424                         propCast.type = PropertyCast::NUMBER;
425                         propCast.value.numberValue = __effectTimePassed;
426                         break;
427                 case N_EFFECT_DURATION:
428                         propCast.type = PropertyCast::NUMBER;
429                         propCast.value.numberValue = __effectDuration;
430                         break;
431                 default:
432                         propCast.type = PropertyCast::NO_PROPERTY;
433                         break;
434                 }
435                 return propCast;
436         }
437
438         TypeMapElements::iterator it;
439         if (!FindElement(objID, it))
440         {
441                 PropertyCast propCast = {PropertyCast::NO_PROPERTY, {0} };
442                 propCast.type = PropertyCast::NO_PROPERTY;
443                 return propCast;
444         }
445         else
446         {
447                 return it->second->GetProperty(property);
448         }
449 }
450
451 bool
452 EffectModel::ScriptUpdateBitmap(long graphicalSurfaceId, long bitmapId)
453 {
454         TypeMapGSurface::iterator it;
455         if (!FindGraphicalSurface(graphicalSurfaceId, it))
456         {
457                 return false;
458         }
459         else
460         {
461                 it->second->SetBitmapId(bitmapId);
462         }
463         return __pEMListener->OnBitmapRequested(bitmapId);
464 }
465
466 RenderDataScene*
467 EffectModel::GetRenderingData(void) const
468 {
469         return __pRenderDataScene.get();
470 }
471
472 PropertyCast
473 EffectModel::ScriptGetNearestPointsIds(long graphicalSurfaceId, Vec3f &position) const
474 {
475         TypeMapGSurface::iterator it;
476         if (!FindGraphicalSurface(graphicalSurfaceId, it))
477         {
478                 PropertyCast propCast = {PropertyCast::BOOL, {false}};
479                 return propCast;
480         }
481         return it->second->GetNearestPointsIds(position);
482 }
483
484 void
485 EffectModel::Construct(void)
486 {
487         if (__state != _EFFECT_STATE_INITIALIZING)
488         {
489                 return;
490         }
491
492         TypeMSurfacesCollection::iterator it;
493         for (it = __pMSurfacesCollection->begin(); it != __pMSurfacesCollection->end(); ++it)
494         {
495                 (*it)->Construct(__pMapElements.get(), __pMapGSurface.get(), &(__pRenderDataScene->__renderDataSurfaceCollection));
496         }
497
498         InitEffectModel();
499         return;
500 }
501
502 void
503 EffectModel::UpdateGraphicalSurfaces(void)
504 {
505         if (__state == _EFFECT_STATE_RUNNING || __state == _EFFECT_STATE_STARTING || __state == _EFFECT_STATE_FINISHING)
506         {
507                 TypeMSurfacesCollection::iterator it;
508                 for ( it = __pMSurfacesCollection->begin(); it != __pMSurfacesCollection->end(); ++it )
509                 {
510                         (*it)->UpdateGraphicalSurface();
511                 }
512         }
513         return;
514 }
515
516 bool
517 EffectModel::ScriptRotateSurface(long graphicalSurfaceId, float angle, _Axis axis, _Point point,
518                                                                 float ax, float ay, float az, float x0, float y0, float z0)
519 {
520         TypeMapGSurface::iterator it;
521         if (!FindGraphicalSurface(graphicalSurfaceId, it))
522         {
523                 return false;
524         }
525         else
526         {
527                 return it->second->RotateSurface(angle, axis, point,
528                                                                                  ax, ay, az, x0, y0, z0);
529         }
530 }
531
532 bool
533 EffectModel::ScriptScaleSurface(long graphicalSurfaceId, float ax, float ay, float az, _Point point,
534                                                                 float x0, float y0, float z0)
535 {
536         TypeMapGSurface::iterator it;
537         if (!FindGraphicalSurface(graphicalSurfaceId, it))
538         {
539                 return false;
540         }
541         else
542         {
543                 return it->second->ScaleSurface(ax, ay, az, point,
544                                                                                 x0, y0, z0);
545         }
546 }
547
548 bool
549 EffectModel::ScriptMoveSurface(long graphicalSurfaceId, float x0, float y0, float z0)
550 {
551         TypeMapGSurface::iterator it;
552         if (!FindGraphicalSurface(graphicalSurfaceId, it))
553         {
554                 return false;
555         }
556         else
557         {
558                 it->second->MoveSurface(x0, y0, z0);
559                 return true;
560         }
561 }
562
563 bool
564 EffectModel::ScriptResetSurfaceTransformation(long graphicalSurfaceID)
565 {
566         TypeMapGSurface::iterator it;
567         if (!FindGraphicalSurface(graphicalSurfaceID, it))
568         {
569                 return false;
570         }
571         else
572         {
573                 it->second->ResetSurfaceTransformation();
574                 return true;
575         }
576 }
577
578 bool
579 EffectModel::ScriptSetTransformationMatrix(long graphicalSurfaceID, const LuaMatrix4& luaMatrix4)
580 {
581         TypeMapGSurface::iterator it;
582         if (!FindGraphicalSurface(graphicalSurfaceID, it))
583         {
584                 return false;
585         }
586         else
587         {
588                 it->second->SetTransformationMatrix(luaMatrix4);
589                 return true;
590         }
591 }
592
593 inline bool
594 EffectModel::FindElement(long objID, TypeMapElements::iterator &it) const
595 {
596         it = __pMapElements->find(objID);
597         return (it != __pMapElements->end());
598 }
599
600 inline bool
601 EffectModel::FindGraphicalSurface(long objID, TypeMapGSurface::iterator &it) const
602 {
603         it = __pMapGSurface->find(objID);
604         return (it != __pMapGSurface->end());
605 }
606
607 inline void
608 EffectModel::InitEffectModel(void)
609 {
610         __effectTimePassed = 0;
611         __effectResult.effectResult = static_cast<EffectResult>(0);
612         __effectResult.lastShownBitmapsId = LastShownBitmapIdCollection(1, 1);
613
614         if (!__pScript->Initialize())
615         {
616                 __state = _EFFECT_STATE_RUNTIME_ERROR;
617         }
618         else
619         {
620                 __state = _EFFECT_STATE_RUNNABLE;
621         }
622         return;
623 }
624
625 //lighting
626 bool
627 EffectModel::ScriptAddUnitLight(UnitLight& unitLight)
628 {
629         return __pRenderDataScene->AddUnitLight(unitLight);
630 }
631
632 bool
633 EffectModel::ScriptRemoveUnitLight(const string& name)
634 {
635         return __pRenderDataScene->RemoveUnitLight(name);
636 }
637
638 bool
639 EffectModel::ScriptRemoveAllUnitsLightType(TypeUnitLight typeUnitLight)
640 {
641         return __pRenderDataScene->RemoveAllUnitsLightType(typeUnitLight);
642 }
643
644 PropertyCast
645 EffectModel::ScriptGetUnitLight(const string& name) const
646 {
647         return __pRenderDataScene->GetUnitLight(name);
648 }
649
650 void
651 EffectModel::ScriptSetLightAmbientColour(const Vec3f& ambientColour)
652 {
653         __pRenderDataScene->SetLightAmbientColour(ambientColour);
654         return;
655 }
656
657 void
658 EffectModel::ScriptSetLightAmbientColour(float red, float green, float blue)
659 {
660         __pRenderDataScene->SetLightAmbientColour(red, green, blue);
661         return;
662 }
663
664 void
665 EffectModel::ScriptSetLightIntensity(float intensity)
666 {
667         __pRenderDataScene->SetLightIntensity(intensity);
668         return;
669 }
670
671 void
672 EffectModel::ScriptSetLightAttenuation(float attenuation)
673 {
674         __pRenderDataScene->SetLightAttenuation(attenuation);
675         return;
676 }
677
678 const Vec3f&
679 EffectModel::ScriptGetLightAmbientColour(void) const
680 {
681         return __pRenderDataScene->GetLightAmbientColour();
682 }
683
684 float
685 EffectModel::ScriptGetLightIntensity(void) const
686 {
687         return __pRenderDataScene->GetLightIntensity();
688 }
689
690 float
691 EffectModel::ScriptGetLightAttenuation(void) const
692 {
693         return __pRenderDataScene->GetLightAttenuation();
694 }
695 ///////////////////////////////////////////////////
696 long
697 EffectModel::GetId(void) const
698 {
699         return __effectID;
700 }
701
702 std::string
703 EffectModel::GetName(void) const
704 {
705         return __name;
706 }
707
708 } } } } // Tizen::Ui::Effects::_Runtime