Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / effects / inc / FUiEffects_PePointSurfaceNURBS.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_PePointSurfaceNURBS.h
19 * @brief       This is the header file for the PointSurfaceNurbs class
20 */
21
22 #ifndef _FUI_EFFECTS_INTERNAL_PE_POINTSURFACENURBS_H_
23 #define _FUI_EFFECTS_INTERNAL_PE_POINTSURFACENURBS_H_
24 #pragma once
25
26 #include "FUiEffects_PePointSurface.h"
27
28 namespace Tizen { namespace Ui { namespace Effects { namespace _PhysicsEngine
29 {
30
31 /**
32  * @class       PointSurfaceNURBS
33  * @brief       Class for graphical element: nurbs point
34  *
35  * @since 2.0
36  *
37  */
38 class PointSurfaceNurbs
39         : public PointSurface
40 {
41
42 public:
43
44         /**
45          * PointSurfaceNURBS class constructor
46          *
47          * simce 3.0
48          *
49          * @param[in]   objId                   physical element's id
50          * @param[in]   positionInit    point initial position
51          * @param[in]   massInit                point initial mass
52          * @param[in]   weightInit              NURBS initial weight
53          * @param[in]   fixed                   point fixation setting
54          * @param[in]   row                     row number in grid
55          * @param[in]   col                     column number in grid
56          *
57          */
58         PointSurfaceNurbs(
59                 long            objId,
60                 Tizen::Ui::Effects::_Utils::Vec3f               positionInit,
61                 float                   massInit,
62                 float pointEnvResist,
63                 float                   weightInit,
64                 bool                    fixed,
65                 unsigned int    row,
66                 unsigned int    col
67         );
68
69         /**
70          * Class destructor
71          *
72          * @since 2.0
73          *
74          */
75         virtual ~PointSurfaceNurbs();
76
77         /**
78          * Gets object's type
79          *
80          * @since 2.0
81          *
82          * @return              enum value that corresponds to object's type
83          *
84          */
85         virtual Tizen::Ui::Effects::_Runtime::ESurface GetType(void) const;
86
87         /**
88          * Sets object into the initial state
89          *
90          * @since 2.0
91          *
92          */
93         virtual void Initialize(void);
94
95         /**
96          * Binds point with model parameters
97          *
98          * @since 2.0
99          *
100          * @return              binding result, successful - true, failed - false
101          * @param[in]   pEnvResist              pointer to environmental resistance value
102          * @param[in]   pGravAcc                pointer to gravity acceleration vector
103          * @param[in]   pGroundLevel    pointer to model ground level value
104          *
105          */
106         virtual bool Construct(
107                 const float* pEnvResist,
108                 const Tizen::Ui::Effects::_Utils::Vec3f* pGravAcc,
109                 const float* pGroundLevel
110         );
111
112         /**
113          * Performs simulation step with given delta time
114          *
115          * @since 2.0
116          *
117          * @param[in]   timeStep        simulation time step
118          *
119          */
120         virtual void Calculate(float timeStep);
121
122         /**
123          * Gets element property value
124          *
125          * @since 2.0
126          *
127          * @return              struct that contains property type and value
128          * @param[in]   property        enum value for necessary property
129          *
130          */
131         virtual Tizen::Ui::Effects::_Runtime::PropertyCast GetProperty(
132                 Tizen::Ui::Effects::_Runtime::ElementProperty property
133         ) const;
134
135         /**
136          * Sets element bool property values
137          *
138          * @since 2.0
139          *
140          * @return              true if set successful, false if failed
141          * @param[in]   property        property name
142          * @param[in]   boolValue       new bool value for property
143          *
144          */
145         virtual bool SetProperty(
146                 Tizen::Ui::Effects::_Runtime::ElementProperty property,
147                 bool boolValue
148         );
149
150         /**
151          * Sets element numeric property values
152          *
153          * @since 2.0
154          *
155          * @return              true if set successful, false if failed
156          * @param[in]   property                property name
157          * @param[in]   numericValue    new numeric value for property
158          *
159          */
160         virtual bool SetProperty(
161                 Tizen::Ui::Effects::_Runtime::ElementProperty property,
162                 LUA_NUMBER numericValue
163         );
164
165         /**
166          * Sets element vector property values
167          *
168          * @since 2.0
169          *
170          * @return              true if set successful, false if failed
171          * @param[in]   property                property name
172          * @param[in]   vectorValue     new vector value for property
173          *
174          */
175         virtual bool SetProperty(
176                 Tizen::Ui::Effects::_Runtime::ElementProperty property,
177                 const Tizen::Ui::Effects::_Utils::Vec3f & vectorValue
178         );
179
180         /**
181          * Gets NURBS weight
182          *
183          * @since 2.0
184          *
185          * @return              NURBS weight value
186          *
187          */
188         float GetWeight(void) const;
189
190         /**
191          * Gets grid row which contains this point
192          *
193          * @since 2.0
194          *
195          * @return              grid row number
196          *
197          */
198         unsigned int GetRow(void) const;
199
200         /**
201          * Gets grid column which contains this point
202          *
203          * @since 2.0
204          *
205          * @return              grid column number
206          *
207          */
208         unsigned int GetCol(void) const;
209
210 protected:
211
212 private:
213         // internal initialize function
214         void InitPointNurbs(void);
215
216 public:
217
218 protected:
219
220 private:
221         // initial values
222         const float __nurbsWeightInit;
223
224         // current simulation values
225         float __nurbsWeight;
226
227         unsigned int __row;
228         unsigned int __col;
229
230 }; // PointSurfaceNURBS
231
232 } } } } // Tizen::Ui::Effects::_PhysicsEngine
233
234 #endif //_FUI_EFFECTS_INTERNAL_PE_POINTSURFACENURBS_H_