Remove unused FindActorByAlias
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / transition-effects / cube-transition-wave-effect-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_WAVE_EFFECT_H__
2 #define __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_WAVE_EFFECT_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.h>
25 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 class CubeTransitionWaveEffect;
34
35 namespace Internal
36 {
37
38 class CubeTransitionEffect;
39
40 class CubeTransitionWaveEffect : public CubeTransitionEffect
41 {
42
43 public:
44
45   /**
46    * @copydoc Toolkit::CubeTransitionWaveEffect::New
47    */
48   static Toolkit::CubeTransitionWaveEffect New(unsigned int numRows, unsigned int numColumns, Size viewAreaSize);
49
50 protected:
51
52   /**
53    * @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
54    */
55   virtual void OnInitialize();
56
57   /**
58    * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
59    */
60   virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement );
61
62   /**
63    * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStopTransition
64    */
65   virtual void OnStopTransition();
66
67 private:
68
69   /**
70    * Construct a new CubeTransitionWaveEffect object
71    * @param[in] numRows How many rows of cubes
72    * @param[in] numColumns How many columns of cubes
73    * @param[in] viewAreaSize The size of view area for this transition effect
74    */
75   CubeTransitionWaveEffect( unsigned int numRows, unsigned int numColumns, Size viewAreaSize );
76
77   /**
78    * The Saddle surface (Hyperbolic paraboloid)function is used to calculate the delay of rotating animation for each cube
79    * This function calculates the Hyperbolic paraboloid parameters,
80    * and the translation and rotation params for mapping the current stage coordinate to the function defining coordinate system
81    * @param[in] position The press down position of panGesture
82    * @param[in] displacement The displacement vector of panGesture
83    */
84   void CalculateSaddleSurfaceParameters( Vector2 position, Vector2 displacement );
85
86   /**
87    * Calculate the delay of the animation for each cube
88    * @param[in] x The X coordinate of the cube
89    * @param[in] y The Y coordinate of the cube
90    * @return The delay time of the animation
91    */
92   float CalculateDelay(float x, float y);
93
94 private:
95
96   //saddle surface(Hyperbolic paraboloid)function, used to calculate the delay time of each cube
97   //z = 1.0 + y*y/a/a - x*x/b/b
98   //with our selection of parameters(a and b), this value for any cube is between 0.0 and 2.0
99   float                      mSaddleAA; //a*a
100   float                      mSaddleBB; //b*b
101   float                      mSaddleB;  //b
102   Vector2                    mTranslation;
103   Vector2                    mRotation;
104
105 }; // class CubeTransitionWaveEffect
106
107 } // namespace Internal
108
109 // Helpers for public-api forwarding methods
110
111 inline Internal::CubeTransitionWaveEffect& GetImpl(Dali::Toolkit::CubeTransitionWaveEffect& obj)
112 {
113   DALI_ASSERT_ALWAYS(obj);
114
115   Dali::BaseObject& handle = obj.GetBaseObject();
116
117   return static_cast<Internal::CubeTransitionWaveEffect&>(handle);
118 }
119
120 inline const Internal::CubeTransitionWaveEffect& GetImpl(const Dali::Toolkit::CubeTransitionWaveEffect& obj)
121 {
122   DALI_ASSERT_ALWAYS(obj);
123
124   const Dali::BaseObject& handle = obj.GetBaseObject();
125
126   return static_cast<const Internal::CubeTransitionWaveEffect&>(handle);
127 }
128
129 } // namespace Toolkit
130
131 } // namespace Dali
132
133 #endif /* __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_WAVE_EFFECT_H__ */