Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / effects / inc / FUiEffects_RuntimeSpotLight.h
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_RuntimeSpotLight.h
19  * @brief               This is the header file for a spot light
20  */
21
22 #ifndef _FUI_EFFECTS_INTERNAL_RUNTIME_SPOT_LIGHT_H_
23 #define _FUI_EFFECTS_INTERNAL_RUNTIME_SPOT_LIGHT_H_
24
25 #include <string>
26 #include <utils/FUiEffects_Utils.h>
27 #include <FUiEffects_RuntimePointLight.h>
28
29 namespace Tizen { namespace Ui { namespace Effects { namespace _Runtime
30 {
31
32 //tolua_begin           <--(!do not edit!)the beginning of export part to lua
33 class SpotLight
34         : public PointLight
35 {
36 //tolua_end                     <--(!do not edit!)the ending of export part to lua
37 public:
38
39         /**
40          * Returns a pointer to created spot light
41          *
42          * @since 2.0
43          *
44          */
45         static SpotLight* CreateSpotLight(const std::string& name);
46 #if 0
47         static SpotLight* CreateSpotLight(const string& name);                  //tolua_export          <--(!do not edit!)the exporting line to lua
48 #endif
49
50         /**
51          * Returns a pointer to created spot light
52          *
53          * @since 2.0
54          *
55          */
56         static SpotLight* CreateSpotLight(bool enabled,
57                                                                         const std::string& name,
58                                                                         const Tizen::Ui::Effects::_Utils::Vec3f& colour,
59                                                                         float intensity,
60                                                                         const Tizen::Ui::Effects::_Utils::Vec3f& position,
61                                                                         const Tizen::Ui::Effects::_Utils::Vec3f& target,
62                                                                         float angleOpening,
63                                                                         float angleFadeOut
64                                                                         );
65
66         /**
67          * Returns a target point of a spot (Where does spot shine?)
68          *
69          * @since 2.0
70          *
71          */
72         const Tizen::Ui::Effects::_Utils::Vec3f& GetTarget(void) const;
73 #if 0
74         const Vector3& GetTarget(void) const;                                                   //tolua_export          <--(!do not edit!)the exporting line to lua
75 #endif
76
77         /**
78          * Returns an opening angle of spot (an angle between opposite forming lines of a spot cone)
79          *
80          * @since 2.0
81          *
82          */
83         float GetAngleOpening(void) const;                                                              //tolua_export          <--(!do not edit!)the exporting line to lua
84
85         /**
86          * Returns an angle of fade out for spot
87          * (an angle between some forming line of a spot cone and a some ray from a position of spot which not lies in spot cone)
88          *
89          * @since 2.0
90          *
91          * @remarks             This angle determines how spot light attenuates with angle growing if angle is great than angle opening
92          *
93          */
94         float GetAngleFadeOut(void) const;                                                              //tolua_export          <--(!do not edit!)the exporting line to lua
95
96         /**
97          * Sets a target point for a spot
98          *
99          * @since 2.0
100          *
101          */
102         void SetTarget(const Tizen::Ui::Effects::_Utils::Vec3f& target);
103 #if 0
104         void SetTarget(const Vector3& target);                                                  //tolua_export          <--(!do not edit!)the exporting line to lua
105 #endif
106
107         /**
108          * Sets target point for spot
109          *
110          * @since 2.0
111          *
112          */
113         void SetTarget(float x, float y, float z);                                              //tolua_export          <--(!do not edit!)the exporting line to lua
114
115         /**
116          * Sets an angle opening for a spot
117          *
118          * @since 2.0
119          *
120          */
121         bool SetAngleOpening(float angleOpening);                                               //tolua_export          <--(!do not edit!)the exporting line to lua
122
123         /**
124          * Sets an angle of fade out for a spot
125          *
126          * @since 2.0
127          *
128          */
129         bool SetAngleFadeOut(float angleFadeOut);                                               //tolua_export          <--(!do not edit!)the exporting line to lua
130
131         /**
132          * Returns a type of a spot light as variable of enumeration type
133          *
134          * @since 2.0
135          *
136          */
137         virtual TypeUnitLight GetType(void) const;
138
139         /**
140          * Resets all signs for this instance of class (e.g. isTargetChanged, isColourChanged)
141          *
142          * @since 2.0
143          *
144          */
145         virtual void ResetSigns(void);
146
147 protected:
148
149         /**
150          * Class constructor
151          *
152          * @since 2.0
153          *
154          * @remarks             Clients of this class can create SpotLight objects with using Create methods only
155          *
156          */
157         SpotLight(const std::string& name);
158
159         /**
160          * Class constructor
161          *
162          * @since 2.0
163          *
164          * @remarks             Clients of this class can create SpotLight objects with using Create methods only
165          *
166          */
167         SpotLight(bool enabled,
168                                 const std::string& name,
169                                 const Tizen::Ui::Effects::_Utils::Vec3f& colour,
170                                 float intensity,
171                                 const Tizen::Ui::Effects::_Utils::Vec3f& position,
172                                 const Tizen::Ui::Effects::_Utils::Vec3f& target,
173                                 float angleOpening,
174                                 float angleFadeOut
175                                 );
176
177         /**
178          * Class destructor
179          *
180          * @since 2.0
181          *
182          * @remarks             Clients of this class can not destroy instances of this class (for purpose to avoid the sending an invalid unit light into scene)
183          *
184          */
185         virtual ~SpotLight(void);
186
187 private:
188
189         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
190         SpotLight(const SpotLight& rhs);
191         // The implementation of this assignment operator is intentionally blank and declared as private to prohibit copying of objects.
192         SpotLight& operator=(const SpotLight& rhs);
193
194 public:
195
196         bool isTargetChanged;
197         bool isAngleOpeningChanged;
198         bool isAngleFadeOutChanged;
199
200 private:
201
202         Tizen::Ui::Effects::_Utils::Vec3f __target;             /**< a target point for a spot (Where does spot shine?) */
203         float __angleOpening;                                                   /**< an angle opening for a spot */
204         float __angleFadeOut;                                                   /**< an angle of fade out for a spot */
205 }; //SpotLight          //tolua_export          <--(!do not edit!)the exporting line to lua
206
207 } } } } // Tizen::Ui::Effects::_Runtime
208
209 #endif  //_FUI_EFFECTS_INTERNAL_RUNTIME_SPOT_LIGHT_H_