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_RuntimePointLight.cpp
19 * @brief This file contains an implementation of PointLight class methods
23 #include <FBaseSysLog.h>
24 #include <FBaseDataType.h>
25 #include <FUiEffects_RuntimePointLight.h>
27 using namespace Tizen::Ui::Effects::_Utils;
30 namespace Tizen { namespace Ui { namespace Effects { namespace _Runtime
33 PointLight::PointLight(const string& name)
35 , isPositionChanged(false)
36 , __position(0.f, 0.f, 0.f)
41 PointLight::PointLight(bool enabled,
45 const Vec3f& position)
46 : UnitLight(enabled, name, colour, intensity)
47 , isPositionChanged(false)
48 , __position(position)
53 PointLight::~PointLight(void)
59 PointLight::CreatePointLight(const string& name)
61 PointLight* pPointLight = new (std::nothrow) PointLight(name);
62 AddUnitLightToPool(pPointLight);
67 PointLight::CreatePointLight(bool isEnabled,
68 const std::string& name,
71 const Vec3f& position)
73 PointLight* pPointLight = new (std::nothrow) PointLight(isEnabled,
78 AddUnitLightToPool(pPointLight);
83 PointLight::GetPosition(void) const
89 PointLight::SetPosition(const Tizen::Ui::Effects::_Utils::Vec3f& position)
91 SetPosition(position.x, position.y, position.z);
96 PointLight::SetPosition(float x, float y, float z)
98 if (fabs(__position.x - x) > EFFECT_EPSILONF
99 || fabs(__position.y - y) > EFFECT_EPSILONF
100 || fabs(__position.z - z) > EFFECT_EPSILONF)
105 isPositionChanged = true;
106 isSomethingChanged = true;
112 PointLight::GetType(void) const
114 return TYPE_UNIT_LIGHT_POINT;
118 PointLight::ResetSigns(void)
120 UnitLight::ResetSigns();
121 isPositionChanged = false;
124 } } } } // Tizen::Ui::Effects::_Runtime