1 #ifndef __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_WAVE_EFFECT_H__
2 #define __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_WAVE_EFFECT_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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
11 // http://floralicense.org/license/
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.
23 #include <dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.h>
24 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
32 class CubeTransitionWaveEffect;
37 class CubeTransitionEffect;
39 class CubeTransitionWaveEffect : public CubeTransitionEffect
45 * @copydoc Toolkit::CubeTransitionWaveEffect::New
47 static Toolkit::CubeTransitionWaveEffect New(unsigned int numRows, unsigned int numColumns, Size viewAreaSize);
52 * @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
54 virtual void OnInitialize();
57 * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
59 virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement );
62 * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStopTransition
64 virtual void OnStopTransition();
69 * Construct a new CubeTransitionWaveEffect object
70 * @param[in] numRows How many rows of cubes
71 * @param[in] numColumns How many columns of cubes
72 * @param[in] viewAreaSize The size of view area for this transition effect
74 CubeTransitionWaveEffect( unsigned int numRows, unsigned int numColumns, Size viewAreaSize );
77 * The Saddle surface (Hyperbolic paraboloid)function is used to calculate the delay of rotating animation for each cube
78 * This function calculates the Hyperbolic paraboloid parameters,
79 * and the translation and rotation params for mapping the current stage coordinate to the function defining coordinate system
80 * @param[in] position The press down position of panGesture
81 * @param[in] displacement The displacement vector of panGesture
83 void CalculateSaddleSurfaceParameters( Vector2 position, Vector2 displacement );
86 * Calculate the delay of the animation for each cube
87 * @param[in] x The X coordinate of the cube
88 * @param[in] y The Y coordinate of the cube
89 * @return The delay time of the animation
91 float CalculateDelay(float x, float y);
95 //saddle surface(Hyperbolic paraboloid)function, used to calculate the delay time of each cube
96 //z = 1.0 + y*y/a/a - x*x/b/b
97 //with our selection of parameters(a and b), this value for any cube is between 0.0 and 2.0
98 float mSaddleAA; //a*a
99 float mSaddleBB; //b*b
101 Vector2 mTranslation;
104 }; // class CubeTransitionWaveEffect
106 } // namespace Internal
108 // Helpers for public-api forwarding methods
110 inline Internal::CubeTransitionWaveEffect& GetImpl(Dali::Toolkit::CubeTransitionWaveEffect& obj)
112 DALI_ASSERT_ALWAYS(obj);
114 Dali::BaseObject& handle = obj.GetBaseObject();
116 return static_cast<Internal::CubeTransitionWaveEffect&>(handle);
119 inline const Internal::CubeTransitionWaveEffect& GetImpl(const Dali::Toolkit::CubeTransitionWaveEffect& obj)
121 DALI_ASSERT_ALWAYS(obj);
123 const Dali::BaseObject& handle = obj.GetBaseObject();
125 return static_cast<const Internal::CubeTransitionWaveEffect&>(handle);
128 } // namespace Toolkit
132 #endif /* __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_WAVE_EFFECT_H__ */