Actor's Transformation API Cleanup 27/36427/4
authorYoonsang Lee <ysang114.lee@samsung.com>
Fri, 6 Mar 2015 08:52:49 +0000 (17:52 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 17 Mar 2015 12:13:29 +0000 (12:13 +0000)
Update for following changes in dali-core:
Actor::MoveBy                     -> TranslateBy
Actor::ColorBy                    -> <removed>
Actor::OpacityBy                  -> <removed>
Actor::SetRotation                -> SetOrientation
Actor::GetCurrentRotation         -> GetCurrentOrientation
Actor::GetCurrentWorldRotation    -> GetCurrentWorldOrientation
Actor::SetInheritRotation         -> SetInheritOrientation
Actor::IsRotationInherited        -> IsOrientationInherited
Actor::Property::ROTATION         -> Actor::Property::ORIENTATION
Actor::Property::WORLD_ROTATION   -> Actor::Property::WORLD_ORIENTATION
Actor::Property::INHERIT_ROTATION -> Actor::Property::INHERIT_ORIENTATION

Change-Id: I0e883d5588e2f18beba32d64a2407253fe1fb286

examples/atlas/atlas-example.cpp
examples/blocks/blocks-example.cpp
examples/cluster/cluster-example.cpp
examples/motion-blur/motion-blur-example.cpp
examples/motion-stretch/motion-stretch-example.cpp
examples/new-window/new-window-example.cpp
examples/path-animation/path-animation.cpp
examples/radial-menu/radial-sweep-view-impl.cpp
examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp
examples/text-view/text-view-example.cpp
resources/scripts/animation.json

index ffb8a3a..bdabc2e 100644 (file)
@@ -165,7 +165,7 @@ public:
   {
     if( gesture.state == Gesture::Continuing )
     {
-      actor.MoveBy( Vector3( gesture.displacement ) );
+      actor.TranslateBy( Vector3( gesture.displacement ) );
     }
   }
 
index 4f723c4..cf1ceae 100644 (file)
@@ -346,7 +346,7 @@ private:
     mPaddleImage.SetSize( mPaddleFullSize );
 
     mWobbleProperty = mPaddle.RegisterProperty(WOBBLE_PROPERTY_NAME, 0.0f);
-    Constraint wobbleConstraint = Constraint::New<Quaternion>( Actor::Property::ROTATION,
+    Constraint wobbleConstraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                                     LocalSource(mWobbleProperty),
                                                     WobbleConstraint(10.0f));
     mPaddle.ApplyConstraint(wobbleConstraint);
index db52250..e8779cc 100644 (file)
@@ -720,12 +720,12 @@ public:
 
           constraint = Constraint::New<float>( angleXAxisProperty,
                                                Source(mScrollView, scrollOvershootProperty),
-                                               Source(mView, Actor::Property::ROTATION),
+                                               Source(mView, Actor::Property::ORIENTATION),
                                                ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::XAXIS) );
           shaderEffect.ApplyConstraint(constraint);
           constraint = Constraint::New<float>( angleYAxisProperty,
                                                Source(mScrollView, scrollOvershootProperty),
-                                               Source(mView, Actor::Property::ROTATION),
+                                               Source(mView, Actor::Property::ORIENTATION),
                                                ShearEffectConstraint(stageSize, SHEAR_EFFECT_MAX_OVERSHOOT, Vector2::YAXIS) );
           shaderEffect.ApplyConstraint(constraint);
 
@@ -752,7 +752,7 @@ public:
 
         Property::Index anglePerUnit = shaderEffect.GetPropertyIndex( shaderEffect.GetAnglePerUnitPropertyName() );
         shaderEffect.ApplyConstraint( Constraint::New<Vector2>( anglePerUnit,
-                                                                Source(mView, Actor::Property::ROTATION),
+                                                                Source(mView, Actor::Property::ORIENTATION),
                                                                 CarouselEffectOrientationConstraint( angleSweep ) ) );
 
         break;
index 6dd39d1..e6bd57b 100644 (file)
@@ -312,7 +312,7 @@ public:
       else
       {
         // set the rotation to match the orientation
-        mView.SetRotation( Degree( -orientation ), Vector3::ZAXIS );
+        mView.SetOrientation( Degree( -orientation ), Vector3::ZAXIS );
         mView.SetSize( targetSize );
       }
     }
index 5e37b51..a7fc7d4 100644 (file)
@@ -225,7 +225,7 @@ public:
       else
       {
         // set the rotation to match the orientation
-        mView.SetRotation( Degree( -orientation ), Vector3::ZAXIS );
+        mView.SetOrientation( Degree( -orientation ), Vector3::ZAXIS );
         mView.SetSize( targetSize );
       }
     }
index e5a514e..3d4f72d 100644 (file)
@@ -262,7 +262,7 @@ FrameBufferImage NewWindowController::CreateFrameBufferForImage(const char* imag
   cameraActor.SetNearClippingPlane(1.0f);
   cameraActor.SetAspectRatio(FBOSize.width / FBOSize.height);
   cameraActor.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-  cameraActor.SetRotation(Quaternion(M_PI, Vector3::YAXIS));
+  cameraActor.SetOrientation(Quaternion(M_PI, Vector3::YAXIS));
   cameraActor.SetPosition(0.0f, 0.0f, ((FBOSize.height * 0.5f) / tanf(Math::PI * 0.125f)));
   stage.Add(cameraActor);
 
index 5dea82a..2611be4 100644 (file)
@@ -247,7 +247,7 @@ public:
     {
       mAnimation.Pause();
       mAnimation.Clear();
-      mActor.SetRotation( Quaternion() );
+      mActor.SetOrientation( Quaternion() );
     }
 
     mAnimation.Animate( mActor, mPath, mForward );
index 7486a8a..02a44b6 100644 (file)
@@ -270,7 +270,7 @@ void RadialSweepViewImpl::Activate( Animation anim, float offsetTime, float dura
     mStencilActor.SetSize(mDiameter, mDiameter);
   }
 
-  mStencilActor.SetRotation( Degree(mInitialAngle), Vector3::ZAXIS );
+  mStencilActor.SetOrientation( Degree(mInitialAngle), Vector3::ZAXIS );
   mStencilActor.SetProperty( mRotationAngleIndex, static_cast<float>(mInitialSector) );
 
   if( mRotateActors )
index 090af52..6b8b917 100644 (file)
@@ -189,7 +189,7 @@ public:
     mView.SetPosition(Vector3(0.0f, 0.0f, -50));
 
     mContents.SetPosition(mTranslation);
-    mContents.SetRotation(CalculateWorldRotation(Radian(mLongitudinal), Radian(mAxisTilt)));
+    mContents.SetOrientation(CalculateWorldRotation(Radian(mLongitudinal), Radian(mAxisTilt)));
     mContents.SetScale(mPinchScale, mPinchScale, mPinchScale);
 
     mPanGestureDetector = PanGestureDetector::New();
@@ -232,7 +232,7 @@ public:
     mLightAnchor = Actor::New();
     mLightAnchor.SetParentOrigin(ParentOrigin::CENTER);
     mLightAnchor.SetAnchorPoint(AnchorPoint::CENTER);
-    mLightAnchor.SetRotation(CalculateWorldRotation(Radian(mLightLongitudinal), Radian(mLightAxisTilt)));
+    mLightAnchor.SetOrientation(CalculateWorldRotation(Radian(mLightLongitudinal), Radian(mLightAxisTilt)));
 
     // Work out a scaling factor as the initial light position was calculated for desktop
     // Need to scale light position as scene actor size is based on stage size (i.e. much bigger on device)
@@ -286,9 +286,9 @@ public:
 
     Property::Index angleIndex = mImageActor2.RegisterProperty("angle", Property::Value(30.0f));
     Source angleSrc( mImageActor2, angleIndex );
-    mImageActor1.ApplyConstraint(Constraint::New<Quaternion>( Actor::Property::ROTATION, angleSrc,
+    mImageActor1.ApplyConstraint(Constraint::New<Quaternion>( Actor::Property::ORIENTATION, angleSrc,
                                                               RotationConstraint(-1.0f)));
-    mImageActor3.ApplyConstraint(Constraint::New<Quaternion>( Actor::Property::ROTATION, angleSrc,
+    mImageActor3.ApplyConstraint(Constraint::New<Quaternion>( Actor::Property::ORIENTATION, angleSrc,
                                                               RotationConstraint(+1.0f)));
 
     mSceneAnimation = Animation::New(2.5f);
@@ -343,7 +343,7 @@ public:
             mLightLongitudinal += gesture.displacement.x/4.0f;
             mLightAxisTilt -= gesture.displacement.y/6.0f;
             mLightAxisTilt = Clamp<float>(mLightAxisTilt, -90.0f, 90.0f);
-            mLightAnchor.SetRotation(CalculateWorldRotation(Radian(mLightLongitudinal), Radian(mLightAxisTilt)));
+            mLightAnchor.SetOrientation(CalculateWorldRotation(Radian(mLightLongitudinal), Radian(mLightAxisTilt)));
             break;
           }
 
@@ -359,7 +359,7 @@ public:
             mLongitudinal += gesture.displacement.x/4.0f;
             mAxisTilt -= gesture.displacement.y/6.0f;
             mAxisTilt = Clamp<float>(mAxisTilt, -90.0f, 90.0f);
-            mContents.SetRotation(CalculateWorldRotation(Radian(mLongitudinal), Radian(mAxisTilt)));
+            mContents.SetOrientation(CalculateWorldRotation(Radian(mLongitudinal), Radian(mAxisTilt)));
             break;
           }
 
@@ -368,7 +368,7 @@ public:
             mObjectLongitudinal += gesture.displacement.x/4.0f;
             mObjectAxisTilt -= gesture.displacement.y/6.0f;
             mObjectAxisTilt = Clamp<float>(mObjectAxisTilt, -90.0f, 90.0f);
-            mSceneActor.SetRotation(CalculateWorldRotation(Radian(mObjectLongitudinal), Radian(mObjectAxisTilt)));
+            mSceneActor.SetOrientation(CalculateWorldRotation(Radian(mObjectLongitudinal), Radian(mObjectAxisTilt)));
             break;
           }
         }
@@ -460,7 +460,7 @@ public:
     // Align scene so that light anchor orientation is Z Axis
     mAxisTilt = -mLightAxisTilt;
     mLongitudinal = -mLightLongitudinal;
-    mContents.SetRotation(CalculateWorldRotation(Radian(mLongitudinal), Radian(mAxisTilt)));
+    mContents.SetOrientation(CalculateWorldRotation(Radian(mLongitudinal), Radian(mAxisTilt)));
 
     return true;
   }
index f91c38b..155a8c4 100644 (file)
@@ -150,7 +150,7 @@ public:
 
       Toolkit::TextView textView = Toolkit::TextView::New( tableString.text );
       textView.SetStyleToCurrentText( textStyle );
-      textView.SetRotation( Dali::Degree( tableString.orientation ), Vector3( 0.0f, 0.0f, 1.0f ) );
+      textView.SetOrientation( Dali::Degree( tableString.orientation ), Vector3( 0.0f, 0.0f, 1.0f ) );
 
       Toolkit::Alignment alignmentContainer = Toolkit::Alignment::New( tableString.horizontalAlignment, tableString.verticalAlignment );
       alignmentContainer.SetPadding( Toolkit::Alignment::Padding( tableString.padding, tableString.padding, tableString.padding, tableString.padding ) );
index 0bbe545..ad13fd1 100644 (file)
@@ -59,7 +59,7 @@
       "duration": 10.0,
       "properties": [{
         "actor": "image", // referenced actors must exist on stage
-        "property": "rotation",
+        "property": "orientation",
         "value": [0, 0, -45],
         "alpha-function": "EASE_IN_OUT",
         "time-period": {
@@ -90,7 +90,7 @@
     "styles": ["basic-text"],
     "position": [0, -120, 0],
     "size": [200, 200, 1],
-    "rotation": [0, 0, 30],
+    "orientation": [0, 0, 30],
     "signals": [{
       "name": "touched",
       "action": "play",
     "parent-origin": "CENTER",
     "anchor-point": "CENTER",
     "size": [200, 200, 1],
-    "rotation": [0, 0, 39],
+    "orientation": [0, 0, 39],
     "position": [-150, -50, 0],
     "text": "or me",
     "signals": [{