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_RuntimeModel.h
19 * @brief This file contains the basic enumerations and structures for working with model
23 #ifndef _FUI_EFFECTS_INTERNAL_RUNTIME_MODEL_H_
24 #define _FUI_EFFECTS_INTERNAL_RUNTIME_MODEL_H_
28 #include <utils/FUiEffects_Utils.h>
29 #include <FUiEffectsTypes.h>
31 namespace Tizen { namespace Ui { namespace Effects { namespace _Runtime
34 const float EFFECT_EPSILONF = std::numeric_limits<float>::epsilon();
36 //tolua_begin <--(!do not edit!)the beginning of export part to lua
40 TYPE_UNIT_LIGHT_POINT,
42 TYPE_UNIT_LIGHT_DIRECTIONAL
48 * Defines possible options of Effect finishing
53 EFFECT_CONTINUED = 1, // Effect continued
54 EFFECT_FINISHED // Effect finished
58 * @enum ElementProperty
60 * For access to Effect's objects property (read, write) from scripts
66 //PointSurface property:
67 B_IS_FIXED, /**< Boolean property is involved into physics calculation*/
68 N_POS_X, /**< Numeric property: the X coordinate of point*/
69 N_POS_Y, /**< Numeric property: the Y coordinate of point*/
70 N_POS_Z, /**< Numeric property: the Z coordinate of point*/
71 N_POS_X_INIT, /**< Numeric property: the initial X coordinate of point*/
72 N_POS_Y_INIT, /**< Numeric property: the initial Y coordinate of point*/
73 N_POS_Z_INIT, /**< Numeric property: the initial Z coordinate of point*/
74 N_MASS, /**< Numeric property: the mass of point*/
75 N_FUSER_X, /**< Numeric property: the X coordinate of user force*/
76 N_FUSER_Y, /**< Numeric property: the Y coordinate of user force*/
77 N_FUSER_Z, /**< Numeric property: the Z coordinate of user force*/
78 N_POINT_RESISTANCE, /**< Numeric property: the resistance of point movement*/
79 V_POS, /**< Userdata property (Vector3): the position of point*/
80 V_POS_INIT, /**< Userdata property (Vector3): the initial position of point*/
81 V_FUSER, /**< Userdata property (Vector3): the user force vector*/
83 //PointSurfaceNURBS property:
84 N_NURBS_WEIGHT, /**< Numeric property: the weight of point (for rendering)*/
86 //RodSurface and SpringSurface property:
87 N_STIFFNESS, /**< Numeric property: the stiffness of spring or rod*/
89 //ModelSurface property:
90 N_ENV_RESISTANCE, /**< Numeric property: the environment resistance to movement*/
91 N_NUMBER_ITERATIONS, /**< Numeric property: number of iterations per one calculation event (not change speed, but more stability)*/
92 N_MODEL_SPEED, /**< Numeric property: model speed as animation multiplier*/
93 N_GRAVITY_ACCEL_VALUE, /**< Numeric property: the length of gravity acceleration vector*/
94 V_GRAVITY_ACCELERATION, /**< Numeric property: gravity acceleration*/
96 //GraphicalSurface property:
97 N_TRANSPARENCY, /**< Numeric property: the surface transparency (from 0 (no transparency) to 1)*/
99 //EffectModel property
100 N_EFFECT_TIME_PASSED, /**< Numeric property: time passed from effect beginning*/
101 N_EFFECT_DURATION /**< Numeric property: effect duration time*/
103 }; // ElementProperty
107 * @enum GroupElements
109 * Enumeration for choosing specified group of elements. @n
110 * For example, is used in function SetPropertyGroup for denoting of group
115 ALL_POINTS, /**< means that property will be applied for all points in the model*/
116 ALL_SPRINGS, /**< means that property will be applied for all springs in the model*/
117 ALL_RODS /**< means that property will be applied for all rods in the model*/
123 * enumeration for choosing specified axis for rotation around it
128 AXIS_X, /**< denote the X axis */
129 AXIS_Y, /**< denote the Y axis */
130 AXIS_Z, /**< denote the Z axis */
131 AXIS_ARBITRARY /**< for denoting arbitrary axis (in case then user may set own arbitrary axis) */
137 * Enumeration for base point on graphical surface specification @n
138 * for using in various transformations such as rotation and scaling
144 POINT_LEFT_TOP, /**< left of horizontal and top of vertical point on a rectangular graphical surface */
145 POINT_CENTER_TOP, /**< center of horizontal and top of vertical point on a rectangular graphical surface */
146 POINT_RIGHT_TOP, /**< right of horizontal and top of vertical point on a rectangular graphical surface */
147 POINT_LEFT_CENTER, /**< left of horizontal and center of vertical point on a rectangular graphical surface */
148 POINT_CENTER_CENTER, /**< center of horizontal and center of vertical point on a rectangular graphical surface */
149 POINT_RIGHT_CENTER, /**< right of horizontal and center of vertical point on a rectangular graphical surface */
150 POINT_LEFT_BOTTOM, /**< left of horizontal and bottom of vertical point on a rectangular graphical surface */
151 POINT_CENTER_BOTTOM, /**< center of horizontal and bottom of vertical point on a rectangular graphical surface */
152 POINT_RIGHT_BOTTOM, /**< right of horizontal and bottom of vertical point on a rectangular graphical surface */
153 POINT_ARBITRARY /**< means that user may specify arbitrary point by it's coordinates */
158 * @class TouchEventScript
160 * Structure for working in scripts-handlers of user's touch events
165 struct TouchEventScript
168 Tizen::Ui::Effects::_Utils::Vec3f currentPosition; /**< current position in touch event info */
169 Tizen::Ui::Effects::_Utils::Vec3f startPosition; /**< first position in touch event info */
170 unsigned long touchId;
173 Vector3 currentPosition; // for export to lua, must be ignored by c++ compiler
174 Vector3 startPosition; // for export to lua, must be ignored by c++ compiler
175 unsigned long touchId; // for export to lua, must be ignored by c++ compiler
177 }; // TouchEventScript
178 //tolua_end <--(!do not edit!)the ending of export part to lua
183 * Defines all possible states of an effect
189 _EFFECT_STATE_RUNNABLE, /**< Ready to start */
190 _EFFECT_STATE_RUNNING, /**< Running */
191 _EFFECT_STATE_RUNTIME_ERROR, /**< Runtime error occurred */
192 _EFFECT_STATE_INITIALIZING, /**< Being initialized */
193 _EFFECT_STATE_STARTING, /**< Starting */
194 _EFFECT_STATE_FINISHING /**< Finishing */
200 * Enumeration for denoting element surface (returning value by function ElementSurface::GetType). @n
201 * The value sequence is important (see ModelSurface::Construct)
207 ESURFACE_MODEL_SURFACE = 0,
208 ESURFACE_GRAPHICAL_SURFACE,
209 ESURFACE_GRAPHICAL_SURFACE_NURBS,
210 ESURFACE_SPRING_SURFACE,
211 ESURFACE_ROD_SURFACE,
212 ESURFACE_POINT_SURFACE,
213 ESURFACE_POINT_SURFACE_NURBS
217 typedef std::list<long> LastShownBitmapIdCollection;
220 * @class EffectResultS
222 * Structure is used in EffectModel instances for runtime result storage
229 EffectResultS(Tizen::Ui::Effects::EffectResult effectResult_ = static_cast<Tizen::Ui::Effects::EffectResult>(0),
230 LastShownBitmapIdCollection lastShownBitmapsId_ = LastShownBitmapIdCollection(1, -1))
231 : effectResult(effectResult_)
232 , lastShownBitmapsId(lastShownBitmapsId_)
236 Tizen::Ui::Effects::EffectResult effectResult;
237 LastShownBitmapIdCollection lastShownBitmapsId;
240 template<class T> class EffectsVector
241 : public std::vector<T>
244 explicit EffectsVector(void) : std::vector<T>()
248 explicit EffectsVector(long n, const T& value = T()) : std::vector<T>(n, value)
252 EffectsVector(const EffectsVector<T>& rhs) :std::vector<T>(rhs)
256 template <class InputIterator>
257 EffectsVector(InputIterator first, InputIterator last) : std::vector<T>(first, last)
261 virtual ~EffectsVector(void)
265 long GetSize(void) const
271 } } } } // Tizen::Ui::Effects::_Runtime
273 #endif //_FUI_EFFECTS_INTERNAL_RUNTIME_MODEL_H_