From: Yoonsang Lee Date: Fri, 6 Mar 2015 08:52:49 +0000 (+0900) Subject: Actor's Transformation API Cleanup X-Git-Tag: dali_1.0.34~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dcc7e2657cbc950685a31a2e74557d53c2fdc24b;p=platform%2Fcore%2Fuifw%2Fdali-demo.git Actor's Transformation API Cleanup Update for following changes in dali-core: Actor::MoveBy -> TranslateBy Actor::ColorBy -> Actor::OpacityBy -> 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 --- diff --git a/examples/atlas/atlas-example.cpp b/examples/atlas/atlas-example.cpp index ffb8a3a..bdabc2e 100644 --- a/examples/atlas/atlas-example.cpp +++ b/examples/atlas/atlas-example.cpp @@ -165,7 +165,7 @@ public: { if( gesture.state == Gesture::Continuing ) { - actor.MoveBy( Vector3( gesture.displacement ) ); + actor.TranslateBy( Vector3( gesture.displacement ) ); } } diff --git a/examples/blocks/blocks-example.cpp b/examples/blocks/blocks-example.cpp index 4f723c4..cf1ceae 100644 --- a/examples/blocks/blocks-example.cpp +++ b/examples/blocks/blocks-example.cpp @@ -346,7 +346,7 @@ private: mPaddleImage.SetSize( mPaddleFullSize ); mWobbleProperty = mPaddle.RegisterProperty(WOBBLE_PROPERTY_NAME, 0.0f); - Constraint wobbleConstraint = Constraint::New( Actor::Property::ROTATION, + Constraint wobbleConstraint = Constraint::New( Actor::Property::ORIENTATION, LocalSource(mWobbleProperty), WobbleConstraint(10.0f)); mPaddle.ApplyConstraint(wobbleConstraint); diff --git a/examples/cluster/cluster-example.cpp b/examples/cluster/cluster-example.cpp index db52250..e8779cc 100644 --- a/examples/cluster/cluster-example.cpp +++ b/examples/cluster/cluster-example.cpp @@ -720,12 +720,12 @@ public: constraint = Constraint::New( 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( 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( anglePerUnit, - Source(mView, Actor::Property::ROTATION), + Source(mView, Actor::Property::ORIENTATION), CarouselEffectOrientationConstraint( angleSweep ) ) ); break; diff --git a/examples/motion-blur/motion-blur-example.cpp b/examples/motion-blur/motion-blur-example.cpp index 6dd39d1..e6bd57b 100644 --- a/examples/motion-blur/motion-blur-example.cpp +++ b/examples/motion-blur/motion-blur-example.cpp @@ -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 ); } } diff --git a/examples/motion-stretch/motion-stretch-example.cpp b/examples/motion-stretch/motion-stretch-example.cpp index 5e37b51..a7fc7d4 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -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 ); } } diff --git a/examples/new-window/new-window-example.cpp b/examples/new-window/new-window-example.cpp index e5a514e..3d4f72d 100644 --- a/examples/new-window/new-window-example.cpp +++ b/examples/new-window/new-window-example.cpp @@ -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); diff --git a/examples/path-animation/path-animation.cpp b/examples/path-animation/path-animation.cpp index 5dea82a..2611be4 100644 --- a/examples/path-animation/path-animation.cpp +++ b/examples/path-animation/path-animation.cpp @@ -247,7 +247,7 @@ public: { mAnimation.Pause(); mAnimation.Clear(); - mActor.SetRotation( Quaternion() ); + mActor.SetOrientation( Quaternion() ); } mAnimation.Animate( mActor, mPath, mForward ); diff --git a/examples/radial-menu/radial-sweep-view-impl.cpp b/examples/radial-menu/radial-sweep-view-impl.cpp index 7486a8a..02a44b6 100644 --- a/examples/radial-menu/radial-sweep-view-impl.cpp +++ b/examples/radial-menu/radial-sweep-view-impl.cpp @@ -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(mInitialSector) ); if( mRotateActors ) diff --git a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp b/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp index 090af52..6b8b917 100644 --- a/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp +++ b/examples/shadow-bone-lighting/shadow-bone-lighting-example.cpp @@ -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( Actor::Property::ROTATION, angleSrc, + mImageActor1.ApplyConstraint(Constraint::New( Actor::Property::ORIENTATION, angleSrc, RotationConstraint(-1.0f))); - mImageActor3.ApplyConstraint(Constraint::New( Actor::Property::ROTATION, angleSrc, + mImageActor3.ApplyConstraint(Constraint::New( 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(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(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(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; } diff --git a/examples/text-view/text-view-example.cpp b/examples/text-view/text-view-example.cpp index f91c38b..155a8c4 100644 --- a/examples/text-view/text-view-example.cpp +++ b/examples/text-view/text-view-example.cpp @@ -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 ) ); diff --git a/resources/scripts/animation.json b/resources/scripts/animation.json index 0bbe545..ad13fd1 100644 --- a/resources/scripts/animation.json +++ b/resources/scripts/animation.json @@ -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", @@ -102,7 +102,7 @@ "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": [{