- try
- {
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN), targetParentOrigin );
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorParentOriginX(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().x, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::PARENT_ORIGIN_X), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetX(1.0f);
-
- try
- {
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_X), targetX );
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorParentOriginY(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().y, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::PARENT_ORIGIN_Y), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetY(1.0f);
-
- try
- {
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_Y), targetY );
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorParentOriginZ(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.5f);
- DALI_TEST_EQUALS( actor.GetCurrentParentOrigin().z, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::PARENT_ORIGIN_Z), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetZ(1.0f);
-
- try
- {
- animation.AnimateTo( Property(actor, Actor::PARENT_ORIGIN_Z), targetZ );
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorAnchorPoint(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), AnchorPoint::CENTER, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetAnchorPoint(AnchorPoint::TOP_LEFT);
-
- try
- {
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT), targetAnchorPoint);
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorAnchorPointX(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.5f);
- DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().x, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::ANCHOR_POINT_X), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetX(1.0f);
-
- try
- {
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_X), targetX );
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorAnchorPointY(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.5f);
- DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().y, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::ANCHOR_POINT_Y), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetY(0.0f);
-
- try
- {
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_Y), targetY );
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorAnchorPointZ(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.5f);
- DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint().z, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::ANCHOR_POINT_Z), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetZ(100.0f);
-
- try
- {
- animation.AnimateTo( Property(actor, Actor::ANCHOR_POINT_Z), targetZ );
- }
- catch (Dali::DaliException& e)
- {
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
- DALI_TEST_ASSERT(e, "IsPropertyAnimatable(index)", TEST_LOCATION);
- }
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorSize(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetSize(100.0f, 100.0f, 100.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE), targetSize );
-
- Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*990.0f)/* 99% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), ninetyNinePercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*10.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
-
- // Reset everything
- finishCheck.Reset();
- actor.SetSize(Vector3::ZERO);
- application.SendNotification();
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
-
- // Repeat with a different (ease-in) alpha function
- animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::SIZE), targetSize, AlphaFunctions::EaseIn);
- animation.FinishedSignal().Connect(&application, finishCheck);
- animation.Play();
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*990.0f)/* 99% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
-
- // The size should have travelled less, than with a linear alpha function
- Vector3 current(actor.GetCurrentSize());
- DALI_TEST_CHECK( current.x > 0.0f );
- DALI_TEST_CHECK( current.y > 0.0f );
- DALI_TEST_CHECK( current.z > 0.0f );
- DALI_TEST_CHECK( current.x < ninetyNinePercentProgress.x );
- DALI_TEST_CHECK( current.y < ninetyNinePercentProgress.y );
- DALI_TEST_CHECK( current.z < ninetyNinePercentProgress.z );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*10.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
-
- // Reset everything
- finishCheck.Reset();
- actor.SetSize(Vector3::ZERO);
- application.SendNotification();
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
-
- // Repeat with a delay
- float delay = 0.5f;
- animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::SIZE), targetSize, AlphaFunctions::Linear, TimePeriod(delay, durationSeconds - delay));
- animation.FinishedSignal().Connect(&application, finishCheck);
- animation.Play();
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% animation progress, 0% animator progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), Vector3::ZERO, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorSizeWidth(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentSize().width, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_WIDTH), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetWidth(10.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE_WIDTH), targetWidth );
-
- float fiftyPercentProgress(startValue + (targetWidth - startValue)*0.5f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize().width, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_WIDTH), fiftyPercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize().width, targetWidth, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_WIDTH), targetWidth, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorSizeHeight(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentSize().height, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_HEIGHT), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetHeight(-10.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE_HEIGHT), targetHeight );
-
- float fiftyPercentProgress(startValue + (targetHeight - startValue)*0.5f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize().height, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_HEIGHT), fiftyPercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize().height, targetHeight, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_HEIGHT), targetHeight, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorSizeDepth(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentSize().depth, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_DEPTH), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetDepth(-10.0f);
- animation.AnimateTo( Property(actor, Actor::SIZE_DEPTH), targetDepth );
-
- float fiftyPercentProgress(startValue + (targetDepth - startValue)*0.5f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize().depth, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_DEPTH), fiftyPercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize().depth, targetDepth, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::SIZE_DEPTH), targetDepth, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorPosition(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- animation.AnimateTo(Property(actor, Actor::POSITION), targetPosition);
-
- Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*750.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), seventyFivePercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorPositionX(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentPosition().x, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetX(1.0f);
- animation.AnimateTo( Property(actor, Actor::POSITION_X), targetX );
-
- float fiftyPercentProgress(startValue + (targetX - startValue)*0.5f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition().x, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition().x, targetX, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), targetX, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorPositionY(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentPosition().y, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetY(10.0f);
- animation.AnimateTo( Property(actor, Actor::POSITION_Y), targetY );
-
- float fiftyPercentProgress(startValue + (targetY - startValue)*0.5f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition().y, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition().y, targetY, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), targetY, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorPositionZ(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- float startValue(0.0f);
- DALI_TEST_EQUALS( actor.GetCurrentPosition().z, startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), startValue, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- float targetZ(-5.0f);
- animation.AnimateTo( Property(actor, Actor::POSITION_Z), targetZ );
-
- float fiftyPercentProgress(startValue + (targetZ - startValue)*0.5f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition().z, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), fiftyPercentProgress, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition().z, targetZ, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::POSITION_Z), targetZ, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorPositionAlphaFunction(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- animation.AnimateTo(Property(actor, Actor::POSITION), targetPosition, AlphaFunctions::EaseIn);
-
- Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
-
- // Start the animation
- animation.Play();
-
- bool signalReceived(false);
- AnimationFinishCheck finishCheck(signalReceived);
- animation.FinishedSignal().Connect(&application, finishCheck);
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*750.0f)/* 75% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
-
- // The position should have moved less, than with a linear alpha function
- Vector3 current(actor.GetCurrentPosition());
- DALI_TEST_CHECK( current.x > Vector3::ZERO.x );
- DALI_TEST_CHECK( current.y > Vector3::ZERO.y );
- DALI_TEST_CHECK( current.z > Vector3::ZERO.z );
- DALI_TEST_CHECK( current.x < seventyFivePercentProgress.x );
- DALI_TEST_CHECK( current.y < seventyFivePercentProgress.y );
- DALI_TEST_CHECK( current.z < seventyFivePercentProgress.z );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationAnimateToActorPositionTimePeriod(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- float delay = 0.5f;
- animation.AnimateTo( Property(actor, Actor::POSITION),
- targetPosition,
- TimePeriod( delay, durationSeconds - delay ) );
-
- Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
-
- // Start the animation
- animation.Play();