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 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
24 #include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
25 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
33 class CubeTransitionWaveEffect;
38 class CubeTransitionEffect;
40 class CubeTransitionWaveEffect : public CubeTransitionEffect
46 * @copydoc Toolkit::CubeTransitionWaveEffect::New
48 static Toolkit::CubeTransitionWaveEffect New(unsigned int numRows, unsigned int numColumns );
53 * @copydoc Toolkit::Internal::CubeTransitionEffect::OnInitialize
55 virtual void OnInitialize();
58 * @copydoc Toolkit::Internal::CubeTransitionEffect::OnStartTransition
60 virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement );
65 * Construct a new CubeTransitionWaveEffect object
66 * @param[in] numRows How many rows of cubes
67 * @param[in] numColumns How many columns of cubes
69 CubeTransitionWaveEffect( unsigned int numRows, unsigned int numColumns );
72 * The Saddle surface (Hyperbolic paraboloid)function is used to calculate the delay of rotating animation for each cube
73 * This function calculates the Hyperbolic paraboloid parameters,
74 * and the translation and rotation params for mapping the current stage coordinate to the function defining coordinate system
75 * @param[in] position The press down position of panGesture
76 * @param[in] displacement The displacement vector of panGesture
78 void CalculateSaddleSurfaceParameters( Vector2 position, Vector2 displacement);
81 * Calculate the delay of the animation for each cube
82 * @param[in] x The X coordinate of the cube
83 * @param[in] y The Y coordinate of the cube
84 * @return The delay time of the animation
86 float CalculateDelay( float x, float y, bool forward );
90 //saddle surface(Hyperbolic paraboloid)function, used to calculate the delay time of each cube
91 //z = 1.0 + y*y/a/a - x*x/b/b
92 //with our selection of parameters(a and b), this value for any cube is between 0.0 and 2.0
93 float mSaddleAA; //a*a
94 float mSaddleBB; //b*b
99 }; // class CubeTransitionWaveEffect
101 } // namespace Internal
103 // Helpers for public-api forwarding methods
105 inline Internal::CubeTransitionWaveEffect& GetImpl( Dali::Toolkit::CubeTransitionWaveEffect& obj )
107 DALI_ASSERT_ALWAYS( obj );
109 Dali::RefObject& handle = obj.GetImplementation();
111 return static_cast< Internal::CubeTransitionWaveEffect& >( handle );
114 inline const Internal::CubeTransitionWaveEffect& GetImpl( const Dali::Toolkit::CubeTransitionWaveEffect& obj )
116 DALI_ASSERT_ALWAYS( obj );
118 const Dali::RefObject& handle = obj.GetImplementation();
120 return static_cast< const Internal::CubeTransitionWaveEffect& >( handle );
123 } // namespace Toolkit
127 #endif /* __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_WAVE_EFFECT_H__ */