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_RuntimeEffectModelScript.h
19 * @brief This is the header file for the EffectModelScript class.
22 #ifndef _FUI_EFFECTS_INTERNAL_RUNTIME_EFFECT_MODEL_SCRIPT_H_
23 #define _FUI_EFFECTS_INTERNAL_RUNTIME_EFFECT_MODEL_SCRIPT_H_
25 #include "utils/FUiEffects_UtilsLuaMat4.h"
26 #include "FUiEffects_RuntimeModel.h"
27 #include "FUiEffects_RuntimeEffectModel.h"
28 #include "FUiEffects_RuntimePropertyCast.h"
30 namespace Tizen { namespace Ui { namespace Effects { namespace _Runtime
34 class IEffectModelScript;
38 * @class EffectModelScript
39 * @brief This class is used by toLua subsystem for binding Lua with EffectModel
45 //tolua_begin <--(!do not edit!)the beginning of export part to lua
46 class EffectModelScript
48 //tolua_end <--(!do not edit!)the ending of export part to lua
52 * EffectModelScript class constructor
57 EffectModelScript(IEffectModelScript* pEModel);
60 * EffectModelScript class destructor
65 ~EffectModelScript(void);
67 //tolua_begin <--(!do not edit!)the beginning of export part to lua
69 * Returns EffectModel's element's property
73 * @remarks Transmits event GetProperty from script functions to up level
74 * via interface IEffectModelScript
76 PropertyCast GetProperty(long objID, ElementProperty property) const;
79 * Sets EffectModel's element's property of boolean type.
83 * @remarks Transmits event SetProperty from script functions to up level
84 * via interface IEffectModelScript
86 bool SetProperty(long objID, ElementProperty property, bool value);
89 * Sets EffectModel's element's property of lua_Number type (floating point or integer).
93 * @remarks Transmits event SetProperty from script functions to up level
94 * via interface IEffectModelScript
96 bool SetProperty(long objID, ElementProperty property, LUA_NUMBER value);
99 * Sets EffectModel's element's property of Vec3f type.
103 * @remarks Transmits event SetProperty from script functions to up level
104 * via interface IEffectModelScript
106 //tolua_end <--(!do not edit!)the ending of export part to lua
107 bool SetProperty(long objID, ElementProperty property, const Tizen::Ui::Effects::_Utils::Vec3f &value);
108 //tolua_begin <--(!do not edit!)the beginning of export part to lua
110 bool SetProperty(long objID, ElementProperty property, const Vector3 &value); //for export to lua, should be ignored by c++ compiler
114 * Sets property's value for elements group
119 bool SetPropertyGroup(long modelSurfaceID, GroupElements group, ElementProperty property, LUA_NUMBER value);
122 * Calculates distance from specified model surface to its ground level
127 PropertyCast GetDistanceFromGround(long modelSurfaceID) const;
130 * Generates request for bitmap updating.
134 * @remarks Transmits event UpdateBitmap from script functions to up level
135 * via interface IEffectModelScript
137 bool UpdateBitmap(long graphicalSurfaceID, long bitmapID);
140 * Returns a vector of vectors of nearest points ID to specified point of graphical surface
144 * @remarks Transmits event GetNearestGPoint from script functions to up level
145 * via interface IEffectModelScript
147 //tolua_end <--(!do not edit!)the ending of export part to lua
148 PropertyCast GetNearestPointsIds(long graphicalSurfaceID, Tizen::Ui::Effects::_Utils::Vec3f &position) const;
149 //tolua_begin <--(!do not edit!)the beginning of export part to lua
151 PropertyCast GetNearestPointsIds(long graphicalSurfaceID, Vector3 &position) const; //for export to lua, should be ignored by c++ compiler
155 * Returns a vector of vectors of nearest points ID to specified point of graphical surface
159 * @remarks Transmits event GetNearestGPoint from script functions to up level
160 * via interface IEffectModelScript
162 PropertyCast GetNearestPointsIds(long graphicalSurfaceID, float posX, float posY, float posZ) const;
165 * Rotates model matrix by the Angle around Axis drawn from the Point
169 * @return Returns true if model matrix was changed successfully and false otherwise
170 * @param [in] GraphicalSurfaceID: ID of graphical surface which matrix has to be rotated
171 * @param [in] Angle: The angle of rotation (radians)
172 * @param [in] Axis: One of the axes (X, Y, Z, ARBITRARY) around which rotation will be performed
173 * @param [in] Point: Base point on graphical surface which coordinates are not change
174 * @param [in] ax, ay, az: The coordinates of axis around which rotation will be performed (in case Axis=AXIS_ARBITRARY)
175 * @param [in] x0, y0, z0: Base point which coordinates are not change (in case Point=POINT_ARBITRARY)
178 bool RotateSurfaceN(long graphicalSurfaceID, float angle, _Axis axis, _Point point,
179 float ax = 0.f, float ay = 0.f, float az = 1.f, float x0 = 0.f, float y0 = 0.f, float z0 = 0.f);
182 * Rotates model matrix by the Angle around Axis drawn from the Point
186 * @return Returns true if model matrix was changed successfully and false otherwise
187 * @param [in] GraphicalSurfaceID: ID of graphical surface which matrix has to be rotated
188 * @param [in] Angle: The angle of rotation (radians)
189 * @param [in] Axis: One of the axes (X, Y, Z, ARBITRARY) around which rotation will be performed
190 * @param [in] Point: Base point on graphical surface which coordinates are not change
191 * @param [in] vAxis: The axis as vector around which rotation will be performed (in case Axis=AXIS_ARBITRARY)
192 * @param [in] vBasePoint0: Base point which coordinates are not change (in case Point=POINT_ARBITRARY)
195 //tolua_end <--(!do not edit!)the ending of export part to lua
196 bool RotateSurfaceV(long graphicalSurfaceID, float angle, _Axis axis, _Point point,
197 const Tizen::Ui::Effects::_Utils::Vec3f &axisArbit = Tizen::Ui::Effects::_Utils::Vec3f(0.f, 0.f, 1.f), const Tizen::Ui::Effects::_Utils::Vec3f &basePointArbit = Tizen::Ui::Effects::_Utils::Vec3f(0.f, 0.f, 0.f));
198 //tolua_begin <--(!do not edit!)the beginning of export part to lua
200 bool RotateSurfaceV(long graphicalSurfaceID, float angle, _Axis axis, _Point point,
201 const Vector3 &axisArbit = Vector3(0.f, 0.f, 1.f), const Vector3 &basePointArbit = Vector3(0.f, 0.f, 0.f)); //for export to lua, should be ignored by c++ compiler
205 * Scales model matrix by the factors ax, ay, az relative to the axes
209 * @return Returns true if model matrix was changed successfully and false otherwise
210 * @param [in] GraphicalSurfaceID: ID of graphical surface which matrix has to be scaled
211 * @param [in] ax, ay, az: Multipliers for scaling along the axes
212 * @param [in] Point: Base point on graphical surface which coordinates are not change
213 * @param [in] x0, y0, z0: Base point which coordinates are not change (in case point=POINT_ARBITRARY)
216 bool ScaleSurface(long graphicalSurfaceID, float ax, float ay, float az, _Point point,
217 float x0 = 0.f, float y0 = 0.f, float z0 = 0.f);
220 * Scales model matrix by the factors encapsulated in vector vMultiplier
224 * @return Returns true if model matrix was changed successfully and false otherwise
225 * @param [in] GraphicalSurfaceID: ID of graphical surface which matrix has to be scaled
226 * @param [in] vMultiplier: Vector of multipliers for scaling along the axes
227 * @param [in] Point: Base point on graphical surface which coordinates are not change (the coordinates of this point do not change)
228 * @param [in] vBasePopint0: Base point which coordinates are not change (if case point=POINT_ARBITRARY)
231 //tolua_end <--(!do not edit!)the ending of export part to lua
232 bool ScaleSurface(long graphicalSurfaceID, const Tizen::Ui::Effects::_Utils::Vec3f &multipliers, _Point point,
233 const ::Tizen::Ui::Effects::_Utils::Vec3f &basePoint = Tizen::Ui::Effects::_Utils::Vec3f(0.f, 0.f, 0.f));
234 //tolua_begin <--(!do not edit!)the beginning of export part to lua
236 bool ScaleSurface(long graphicalSurfaceID, const Vector3 &multipliers, _Point point,
237 const Vector3 &basePoint = Vector3(0.f, 0.f, 0.f)); //for export to lua, should be ignored by c++ compiler
241 * Translates model matrix by values x0, y0 and z0 relative to the axes
245 * @return Returns true if model matrix was changed successfully and false otherwise
246 * @param [in] GraphicalSurfaceID: ID of graphical surface which matrix has to be translated
247 * @param [in] x0, y0, z0: the coordinates of destination point
250 bool MoveSurface(long graphicalSurfaceID, float x0, float y0, float z0);
253 * Translates model matrix by vector vPointTarget
257 * @return Returns true if model matrix was changed successfully and false otherwise
258 * @param [in] GraphicalSurfaceID: ID of graphical surface which matrix has to be translated
259 * @param [in] vPointTarget: destination point
262 //tolua_end <--(!do not edit!)the ending of export part to lua
263 bool MoveSurface(long graphicalSurfaceID, const Tizen::Ui::Effects::_Utils::Vec3f &pointTarget);
264 //tolua_begin <--(!do not edit!)the beginning of export part to lua
266 bool MoveSurface(long graphicalSurfaceID, const Vector3 &pointTarget); //for export to lua, should be ignored by c++ compiler
270 * Sets identity model matrix
274 * @return Returns true if model matrix was changed successfully and false otherwise
276 bool ResetSurfaceTransformation(long graphicalSurfaceID);
279 * Function for redirection of lua print information
283 * @remarks Is called from lua function print(...)
285 static void PrintLuaInfo(const char* pStr);
288 * Sets the model matrix for specified graphical surface
292 // tolua_end <--(!do not edit!)the ending of export part to lua
293 bool SetTransformationMatrix(long graphicalSurfaceID, const Tizen::Ui::Effects::_Utils::LuaMatrix4& luaMatrix4);
294 // tolua_begin <--(!do not edit!)the beginning of export part to lua
296 bool SetTransformationMatrix(long graphicalSurfaceID, const LuaMatrix4& luaMatrix4);
299 // tolua_end <--(!do not edit!)the ending of export part to lua
302 * Adds new unit light to scene
306 * @remarks Returns true if addition was succeeded and false otherwise
308 bool AddUnitLight(UnitLight& unitLight); //tolua_export
311 * Excludes specified unit light from scene with using unique name of it
315 * @remarks Returns true if addition was succeeded and false otherwise
317 bool RemoveUnitLight(const std::string& name);
319 bool RemoveUnitLight(const string& name); //tolua_export
323 * Excludes all units light of specified type from scene
327 * @remarks Returns true if addition was succeeded and false otherwise
329 bool RemoveAllUnitsLightType(TypeUnitLight typeUnitLight); //tolua_export
332 * Returns specified unit light with using unique name of it
337 PropertyCast GetUnitLight(const std::string& name) const;
339 PropertyCast GetUnitLight(const string& name) const; //tolua_export
343 * Sets ambient colour for scene
348 void SetLightAmbientColour(const Tizen::Ui::Effects::_Utils::Vec3f& ambientColour);
350 void SetLightAmbientColour(const Vector3& ambientColour); //tolua_export
354 * Sets ambient colour for scene
359 void SetLightAmbientColour(float red, float green, float blue); //tolua_export
362 * Sets light intensity for scene
367 void SetLightIntensity(float intensity); //tolua_export
370 * Sets attenuation for units light on scene
375 void SetLightAttenuation(float attenuation); //tolua_export
378 * Returns ambient colour of scene
383 const Tizen::Ui::Effects::_Utils::Vec3f& GetLightAmbientColour(void) const;
385 const Vector3& GetLightAmbientColour(void) const; //tolua_export
389 * Returns intensity of units light in a scene (as property of entire scene)
394 float GetLightIntensity(void) const; //tolua_export
397 * Returns attenuation for units light on scene
402 float GetLightAttenuation(void) const; //tolua_export
406 * Hidden copy constructor
411 EffectModelScript(const EffectModelScript &rhs);
414 * Hidden assignment operator
419 EffectModelScript &operator=(const EffectModelScript &rhs);
423 IEffectModelScript* __pEModel; /**< pointer to interface IEffectModelScript (for transmitting events from script to up level)*/
425 }; // EffectModelScript //tolua_export <--(!do not edit!)exporting one line to lua
427 } } } } // Tizen::Ui::Effects::_Runtime
429 #endif //_FUI_EFFECTS_INTERNAL_RUNTIME_EFFECT_MODEL_SCRIPT_H_