Merge "Fixed Control and Magnifier API" into tizen
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / transition-effects / cube-transition-wave-effect-impl.cpp
index 4754938..818e670 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // CLASS HEADER
 #include "cube-transition-wave-effect-impl.h"
@@ -27,7 +28,10 @@ namespace Internal
 {
 
 CubeTransitionWaveEffect::CubeTransitionWaveEffect( unsigned int numRows, unsigned int numColumns, Size viewAreaSize )
-: CubeTransitionEffect( numRows, numColumns, viewAreaSize)
+: CubeTransitionEffect( numRows, numColumns, viewAreaSize),
+  mSaddleAA( 1.f ),
+  mSaddleBB( 1.f ),
+  mSaddleB( 1.f )
 {
 }
 
@@ -70,15 +74,15 @@ void CubeTransitionWaveEffect::OnStartTransition( Vector2 panPosition, Vector2 p
   {
     for( unsigned int idx = 0; idx < totalNum; idx++ )
     {
-      mTiles[mContainerIndex][idx].SetRotation( Degree( angle),  Vector3::YAXIS );
+      mTiles[mContainerIndex][idx].SetOrientation( Degree( angle),  Vector3::YAXIS );
     }
   }
   else if(!mChangeTurningDirection)  // reset rotation, translation
   {
     for( unsigned int idx = 0; idx < totalNum; idx++ )
     {
-      mTiles[mContainerIndex][idx].MoveBy( translation );
-      mTiles[mContainerIndex][idx].SetRotation( Degree( angle),  Vector3::YAXIS );
+      mTiles[mContainerIndex][idx].TranslateBy( translation );
+      mTiles[mContainerIndex][idx].SetOrientation( Degree( angle),  Vector3::YAXIS );
     }
   }
 
@@ -93,14 +97,14 @@ void CubeTransitionWaveEffect::OnStartTransition( Vector2 panPosition, Vector2 p
       // the delay value is within 0.f ~ 2.f*thirdAnimationDuration
       float delay = thirdAnimationDuration * CalculateDelay(x*mTileSize.width,y*mTileSize.height);
 
-      mAnimation.RotateTo( mBoxes[idx], Degree( -angle ), Vector3::YAXIS,
-                           AlphaFunctions::EaseOutSine, delay, thirdAnimationDuration );
-      mAnimation.MoveBy( mBoxes[idx], Vector3(0.f,0.f,-mCubeDisplacement),
-                         AlphaFunctions::Bounce, delay, thirdAnimationDuration );
-      mAnimation.ColorTo( mTiles[anotherIndex][idx], HALF_BRIGHTNESS,
-                          AlphaFunctions::EaseOut, delay, thirdAnimationDuration );
-      mAnimation.ColorTo( mTiles[mContainerIndex][idx], FULL_BRIGHTNESS,
-                          AlphaFunctions::EaseIn, delay, thirdAnimationDuration );
+      mAnimation.AnimateTo( Property( mBoxes[idx], Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -angle ) ), Vector3::YAXIS ),
+                            AlphaFunction::EASE_OUT_SINE, TimePeriod( delay, thirdAnimationDuration ) );
+      mAnimation.AnimateBy( Property( mBoxes[idx], Actor::Property::POSITION ), Vector3( 0.f, 0.f, -mCubeDisplacement ),
+                         AlphaFunction::BOUNCE, TimePeriod( delay, thirdAnimationDuration ) );
+      mAnimation.AnimateTo( Property( mTiles[anotherIndex][idx], Actor::Property::COLOR ), HALF_BRIGHTNESS,
+                          AlphaFunction::EASE_OUT, TimePeriod( delay, thirdAnimationDuration ) );
+      mAnimation.AnimateTo( Property( mTiles[mContainerIndex][idx], Actor::Property::COLOR ), FULL_BRIGHTNESS,
+                          AlphaFunction::EASE_IN, TimePeriod( delay, thirdAnimationDuration ) );
     }
   }
 
@@ -114,7 +118,7 @@ void CubeTransitionWaveEffect::OnStopTransition()
   unsigned int totalNum = mNumRows * mNumColumns;
   for( unsigned int idx = 0; idx < totalNum; idx++ )
   {
-    mBoxes[idx].SetRotation( Degree( angle ), Vector3::YAXIS );
+    mBoxes[idx].SetOrientation( Degree( angle ), Vector3::YAXIS );
   }
 }