END_TEST;
}
-int UtcDaliAnimationSetDuratioN(void)
+int UtcDaliAnimationSetDurationP(void)
{
TestApplication application;
// Start the animation
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
animation.Play();
bool signalReceived(false);
END_TEST;
}
-int UtcDaliAnimationGetDuratioN(void)
+int UtcDaliAnimationGetDurationP(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.SetLooping(true);
END_TEST;
}
+int UtcDaliAnimationSetLoopCountP(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+
+ // Start the animation
+ animation.SetLoopCount(3);
+ DALI_TEST_CHECK(animation.IsLooping());
+ animation.Play();
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+
+ // Loop
+ float intervalSeconds = 3.0f;
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+ DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+
+ finishCheck.Reset();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ END_TEST;
+}
+
+int UtcDaliAnimationSetLoopCountP2(void)
+{
+ TestApplication application;
+
+ //
+ // switching between forever and loop count
+ //
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+ animation.SetEndAction(Animation::Discard);
+
+ // Start the animation
+ animation.SetLoopCount(3);
+ DALI_TEST_CHECK(animation.IsLooping());
+ animation.Play();
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ float intervalSeconds = 3.0f;
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ finishCheck.Reset();
+
+ // Loop forever
+ animation.SetLooping(true);
+ DALI_TEST_CHECK(animation.IsLooping());
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ finishCheck.Reset();
+
+ // Loop N again
+ animation.SetLoopCount(3);
+ DALI_TEST_CHECK(animation.IsLooping());
+ animation.Play();
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ finishCheck.Reset();
+
+ // loop forever
+ animation.SetLooping(true);
+ DALI_TEST_CHECK(animation.IsLooping());
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ finishCheck.Reset();
+
+ // Loop N again
+ animation.SetLoopCount(3);
+ DALI_TEST_CHECK(animation.IsLooping());
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived(); // we never hit play
+
+ finishCheck.Reset();
+
+
+ END_TEST;
+}
+
+int UtcDaliAnimationSetLoopCountP3(void)
+{
+ TestApplication application;
+
+ //
+ // switching between forever and loop count
+ //
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+ animation.SetEndAction(Animation::Discard);
+
+ float intervalSeconds = 3.0f;
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ // loop forever
+ animation.SetLooping(true);
+ DALI_TEST_CHECK(animation.IsLooping());
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ finishCheck.Reset();
+
+ // Loop N again
+ animation.SetLoopCount(3);
+ DALI_TEST_CHECK(animation.IsLooping());
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived(); // we never hit play
+
+ finishCheck.Reset();
+
+
+ END_TEST;
+}
+
+int UtcDaliAnimationSetLoopCountP4(void)
+{
+ TestApplication application;
+
+ //
+ // ..and play again
+ //
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+ animation.SetEndAction(Animation::Bake);
+
+ float intervalSeconds = 3.0f;
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ animation.SetLoopCount(1);
+ animation.Play();
+ DALI_TEST_CHECK(!animation.IsLooping());
+
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
+ actor.SetProperty( Actor::Property::POSITION, Vector3(0.0f, 0.0f, 0.0f) );
+
+ finishCheck.Reset();
+
+ animation.Play(); // again
+ DALI_TEST_CHECK(!animation.IsLooping());
+
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliAnimationGetLoopCountP(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+
+ DALI_TEST_CHECK(1 == animation.GetLoopCount());
+
+ // Start the animation
+ animation.SetLoopCount(3);
+ DALI_TEST_CHECK(animation.IsLooping());
+ DALI_TEST_CHECK(3 == animation.GetLoopCount());
+
+ animation.Play();
+
+ application.Render(0);
+ application.SendNotification();
+
+ // Loop
+ float intervalSeconds = 3.0f;
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+
+ application.Render(0);
+ application.SendNotification();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+
+ animation.SetLoopCount(0);
+ DALI_TEST_CHECK(animation.IsLooping());
+ DALI_TEST_CHECK(0 == animation.GetLoopCount());
+
+ animation.SetLoopCount(1);
+ DALI_TEST_CHECK(!animation.IsLooping());
+ DALI_TEST_CHECK(1 == animation.GetLoopCount());
+
+ END_TEST;
+}
+
+
+int UtcDaliAnimationGetCurrentLoopP(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ Vector3 targetPosition(10.0f, 10.0f, 10.0f);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+
+ // Start the animation
+ animation.SetLoopCount(3);
+ DALI_TEST_CHECK(animation.IsLooping());
+ DALI_TEST_CHECK(0 == animation.GetCurrentLoop());
+ animation.Play();
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+
+ // Loop
+ float intervalSeconds = 3.0f;
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ DALI_TEST_CHECK(2 == animation.GetCurrentLoop());
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+ DALI_TEST_CHECK(3 == animation.GetCurrentLoop());
+ DALI_TEST_CHECK(animation.GetLoopCount() == animation.GetCurrentLoop());
+
+ finishCheck.Reset();
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ DALI_TEST_CHECK(3 == animation.GetCurrentLoop());
+
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.Render(static_cast<unsigned int>(durationSeconds*intervalSeconds*1000.0f));
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ DALI_TEST_CHECK(3 == animation.GetCurrentLoop());
+
+ END_TEST;
+}
+
int UtcDaliAnimationIsLoopingP(void)
{
TestApplication application;
DALI_TEST_CHECK(animation.GetEndAction() == Animation::Bake);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
END_TEST;
}
-int UtcDaliAnimationGetEndActioN(void)
+int UtcDaliAnimationGetEndActionP(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationSetDisconnectActioN(void)
+int UtcDaliAnimationSetDisconnectActionP(void)
{
TestApplication application;
Stage stage( Stage::GetCurrent() );
DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BakeFinal);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
animation.SetDisconnectAction( Animation::Bake );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
animation.SetDisconnectAction( Animation::Discard );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*0.5f*1000.0f)/*Only half the animation*/);
END_TEST;
}
-int UtcDaliAnimationGetDisconnectActioN(void)
+int UtcDaliAnimationGetDisconnectActionP(void)
{
TestApplication application;
Animation animation = Animation::New(1.0f);
END_TEST;
}
-int UtcDaliAnimationSetDefaultAlphaFunctioN(void)
+int UtcDaliAnimationSetDefaultAlphaFunctionP(void)
{
TestApplication application;
Animation animation = Animation::New(1.0f);
AlphaFunction func = animation.GetDefaultAlphaFunction();
- DALI_TEST_EQUALS(func(0.1f), AlphaFunctions::Linear(0.1f), TEST_LOCATION);
+ DALI_TEST_EQUALS(func.GetBuiltinFunction(), AlphaFunction::DEFAULT, TEST_LOCATION);
- animation.SetDefaultAlphaFunction(AlphaFunctions::EaseIn);
+ animation.SetDefaultAlphaFunction(AlphaFunction::EASE_IN);
AlphaFunction func2 = animation.GetDefaultAlphaFunction();
- DALI_TEST_CHECK(func2(0.1f) < AlphaFunctions::Linear(0.1f)); // less progress when easing-in
+ DALI_TEST_EQUALS(func2.GetBuiltinFunction(), AlphaFunction::EASE_IN, TEST_LOCATION);
END_TEST;
}
-int UtcDaliAnimationGetDefaultAlphaFunctioN(void)
+int UtcDaliAnimationGetDefaultAlphaFunctionP(void)
{
TestApplication application;
AlphaFunction func = animation.GetDefaultAlphaFunction();
// Test that the default is linear
- DALI_TEST_EQUALS(func(0.1f), AlphaFunctions::Linear(0.1f), TEST_LOCATION);
+ DALI_TEST_EQUALS(func.GetBuiltinFunction(), AlphaFunction::DEFAULT, TEST_LOCATION);
- animation.SetDefaultAlphaFunction(AlphaFunctions::EaseIn);
+ animation.SetDefaultAlphaFunction(AlphaFunction::EASE_IN);
AlphaFunction func2 = animation.GetDefaultAlphaFunction();
- DALI_TEST_CHECK(func2(0.1f) < AlphaFunctions::Linear(0.1f)); // less progress when easing-in
+ DALI_TEST_EQUALS(func2.GetBuiltinFunction(), AlphaFunction::EASE_IN, TEST_LOCATION);
END_TEST;
}
application.SendNotification();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation from 40% progress
animation.SetCurrentProgress( 0.4f );
application.SendNotification();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
//Trying to set the current cursor outside the range [0..1] is ignored
animation.SetCurrentProgress( -1.0f);
application.SendNotification();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation from 40% progress
animation.SetCurrentProgress( 0.4f );
KeyFrames keyframes = KeyFrames::New();
keyframes.Add( 0.0f, initialPosition);
keyframes.Add( 1.0f, targetPosition );
- animation.AnimateBetween( Property(actor, Actor::Property::POSITION), keyframes, AlphaFunctions::Linear);
+ animation.AnimateBetween( Property(actor, Actor::Property::POSITION), keyframes, AlphaFunction::LINEAR);
//Set speed to be x2
animation.SetSpeedFactor(2.0f);
DALI_TEST_EQUALS( Vector2( 0.4f, 0.9f ), animation.GetPlayRange(), TEST_LOCATION );
Vector3 targetPosition( 100.0f, 100.0f, 100.0f );
- animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunctions::Linear );
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunction::LINEAR );
// Start the animation from 40% progress
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
Animation animation = Animation::New(durationSeconds);
animation.SetDisconnectAction( Animation::Discard );
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Start the animation from 40% progress
animation.PlayFrom( 0.4f );
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
//PlayFrom with an argument outside the range [0..1] will be ignored
animation.PlayFrom(-1.0f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
END_TEST;
}
-int UtcDaliAnimationStoP(void)
+
+int UtcDaliAnimationGetStateP(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ Vector3 targetPosition(100.0f, 100.0f, 100.0f);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+ DALI_TEST_EQUALS( animation.GetState(), Animation::STOPPED, TEST_LOCATION );
+
+ Vector3 fiftyPercentProgress(targetPosition * 0.5f);
+
+ // Start the animation
+ animation.Play();
+
+ DALI_TEST_EQUALS( animation.GetState(), Animation::PLAYING, TEST_LOCATION );
+
+ 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( animation.GetState(), Animation::PLAYING, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress, TEST_LOCATION );
+
+ // Pause the animation
+ animation.Pause();
+ DALI_TEST_EQUALS( animation.GetState(), Animation::PAUSED, TEST_LOCATION );
+ application.SendNotification();
+ application.Render(0.f);
+
+ // Loop 5 times
+ for (int i=0; i<5; ++i)
+ {
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f));
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercentProgress/* Still 50% progress when paused */, TEST_LOCATION );
+ DALI_TEST_EQUALS( animation.GetState(), Animation::PAUSED, TEST_LOCATION );
+ }
+
+ // Keep going
+ finishCheck.Reset();
+ animation.Play();
+ DALI_TEST_EQUALS( animation.GetState(), Animation::PLAYING, TEST_LOCATION );
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*490.0f)/*slightly less than the animation duration*/);
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ DALI_TEST_EQUALS( animation.GetState(), Animation::PLAYING, 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.GetCurrentPosition(), targetPosition, TEST_LOCATION );
+ DALI_TEST_EQUALS( animation.GetState(), Animation::STOPPED, TEST_LOCATION );
+
+ // Check that nothing has changed after a couple of buffer swaps
+ application.Render(0);
+ DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( targetPosition, actor.GetCurrentPosition(), TEST_LOCATION );
+ DALI_TEST_EQUALS( animation.GetState(), Animation::STOPPED, TEST_LOCATION );
+
+ // re-play
+ finishCheck.Reset();
+ animation.Play();
+ DALI_TEST_EQUALS( animation.GetState(), Animation::PLAYING, TEST_LOCATION );
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*490.0f)/*slightly less than the animation duration*/);
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ DALI_TEST_EQUALS( animation.GetState(), Animation::PLAYING, TEST_LOCATION );
+
+
+ END_TEST;
+}
+
+int UtcDaliAnimationStopP(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
END_TEST;
}
-int UtcDaliAnimationStopSetPositioN(void)
+int UtcDaliAnimationStopSetPositionP(void)
{
// Test that Animation::Stop & Actor::SetPosition can be used in conjunction
// i.e. to check that the animation does not interfere with the position set.
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
finishCheck.Reset();
actor.SetPosition(Vector3::ZERO);
Vector3 targetScale(3.0f, 3.0f, 3.0f);
- animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunctions::Linear );
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunction::LINEAR );
animation.Play();
application.SendNotification();
END_TEST;
}
-int UtcDaliAnimationAnimateByBooleaN(void)
+int UtcDaliAnimationAnimateByBooleanP(void)
{
TestApplication application;
// Register a boolean property
bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
END_TEST;
}
-int UtcDaliAnimationAnimateByBooleanAlphaFunctioN(void)
+int UtcDaliAnimationAnimateByBooleanAlphaFunctionP(void)
{
TestApplication application;
// Register a boolean property
bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
Animation animation = Animation::New(durationSeconds);
bool relativeValue(true);
bool finalValue( false || relativeValue );
- animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunctions::EaseIn);
+ animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunction::EASE_IN);
// Start the animation
animation.Play();
// Repeat with relative value "false" - this should be an NOOP
animation = Animation::New(durationSeconds);
bool noOpValue(false);
- animation.AnimateBy(Property(actor, index), noOpValue, AlphaFunctions::EaseIn);
+ animation.AnimateBy(Property(actor, index), noOpValue, AlphaFunction::EASE_IN);
// Start the animation
animation.Play();
// Register a boolean property
bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
// Register a boolean property
bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
float animatorDurationSeconds(durationSeconds * 0.5f);
animation.AnimateBy( Property(actor, index),
relativeValue,
- AlphaFunctions::EaseInOut,
+ AlphaFunction::EASE_IN_OUT,
TimePeriod( animatorDurationSeconds ) );
// Start the animation
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateByFloatAlphaFunctioN(void)
+int UtcDaliAnimationAnimateByFloatAlphaFunctionP(void)
{
TestApplication application;
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
float targetValue(90.0f);
float relativeValue(targetValue - startValue);
- animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunctions::EaseOut);
+ animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunction::EASE_OUT);
float ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateBy(Property(actor, index),
relativeValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register an integer property
int startValue(1);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateByIntegerAlphaFunctioN(void)
+int UtcDaliAnimationAnimateByIntegerAlphaFunctionP(void)
{
TestApplication application;
// Register an integer property
int startValue(1);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
int targetValue(90);
int relativeValue(targetValue - startValue);
- animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunctions::EaseOut);
+ animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunction::EASE_OUT);
int ninetyFivePercentProgress(static_cast<int>(startValue + relativeValue*0.95f + 0.5f));
// Register an integer property
int startValue(10);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateBy(Property(actor, index),
relativeValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateByVector2AlphaFunctioN(void)
+int UtcDaliAnimationAnimateByVector2AlphaFunctionP(void)
{
TestApplication application;
// Register a Vector2 property
Vector2 startValue(100.0f, 100.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
Vector2 targetValue(20.0f, 20.0f);
Vector2 relativeValue(targetValue - startValue);
- animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunctions::EaseOut);
+ animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunction::EASE_OUT);
Vector2 ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(5.0f, 5.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateBy(Property(actor, index),
relativeValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateByVector3AlphaFunctioN(void)
+int UtcDaliAnimationAnimateByVector3AlphaFunctionP(void)
{
TestApplication application;
// Register a Vector3 property
Vector3 startValue(100.0f, 100.0f, 100.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
Vector3 targetValue(20.0f, 20.0f, 20.0f);
Vector3 relativeValue(targetValue - startValue);
- animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunctions::EaseOut);
+ animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunction::EASE_OUT);
Vector3 ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(5.0f, 5.0f, 5.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateBy(Property(actor, index),
relativeValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateByVector4AlphaFunctioN(void)
+int UtcDaliAnimationAnimateByVector4AlphaFunctionP(void)
{
TestApplication application;
// Register a Vector4 property
Vector4 startValue(100.0f, 100.0f, 100.0f, 100.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
Vector4 targetValue(20.0f, 20.0f, 20.0f, 20.0f);
Vector4 relativeValue(targetValue - startValue);
- animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunctions::EaseOut);
+ animation.AnimateBy(Property(actor, index), relativeValue, AlphaFunction::EASE_OUT);
Vector4 ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(5.0f, 5.0f, 5.0f, 5.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateBy(Property(actor, index),
relativeValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
END_TEST;
}
-int UtcDaliAnimationAnimateByActorPositioN(void)
+int UtcDaliAnimationAnimateByActorPositionP(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationAnimateByActorPositionAlphaFunctioN(void)
+int UtcDaliAnimationAnimateByActorPositionAlphaFunctionP(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
- animation.AnimateBy(Property(actor, Actor::Property::POSITION), relativePosition, AlphaFunctions::EaseOut);
+ animation.AnimateBy(Property(actor, Actor::Property::POSITION), relativePosition, AlphaFunction::EASE_OUT);
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
float delay = 0.5f;
animation.AnimateBy(Property(actor, Actor::Property::POSITION),
relativePosition,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
END_TEST;
}
-int UtcDaliAnimationAnimateByActorOrientatioN(void)
+int UtcDaliAnimationAnimateByActorOrientationP(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationAnimateByActorOrientationAlphaFunctioN(void)
+int UtcDaliAnimationAnimateByActorOrientationAlphaFunctionP(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Degree relativeRotationDegrees(360.0f);
Radian relativeRotationRadians(relativeRotationDegrees);
- animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ), AlphaFunctions::EaseIn );
+ animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ), AlphaFunction::EASE_IN );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.25f*0.25f*0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.5f*0.5f*0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 0.75f*0.75f*0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
Radian relativeRotationRadians(relativeRotationDegrees);
float delay = 0.3f;
animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ),
- AlphaFunctions::EaseIn, TimePeriod( delay, durationSeconds - delay ) );
+ AlphaFunction::EASE_IN, TimePeriod( delay, durationSeconds - delay ) );
// Start the animation
animation.Play();
application.SendNotification();
finishCheck.CheckSignalNotReceived();
float progress = max(0.0f, 0.25f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
progress = max(0.0f, 0.5f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
progress = max(0.0f, 0.75f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunctions::EaseIn );
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunction::EASE_IN );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunction::LINEAR, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationAnimateToBooleaN(void)
+int UtcDaliAnimationAnimateToBooleanP(void)
{
TestApplication application;
// Register a boolean property
const bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
END_TEST;
}
-int UtcDaliAnimationAnimateToBooleanAlphaFunctioN(void)
+int UtcDaliAnimationAnimateToBooleanAlphaFunctionP(void)
{
TestApplication application;
// Register a boolean property
const bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
float durationSeconds(2.0f);
Animation animation = Animation::New(durationSeconds);
const bool targetValue( !startValue );
- animation.AnimateTo(Property(actor, "test-property"), targetValue, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(actor, "testProperty"), targetValue, AlphaFunction::EASE_OUT);
// Start the animation
animation.Play();
// Repeat with target value "false"
animation = Animation::New(durationSeconds);
const bool finalValue( !targetValue );
- animation.AnimateTo(Property(actor, index), finalValue, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(actor, index), finalValue, AlphaFunction::EASE_OUT);
// Start the animation
animation.Play();
// Register a boolean property
bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
// Register a boolean property
bool startValue(false);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
float animatorDurationSeconds(durationSeconds * 0.5f);
animation.AnimateTo( Property(actor, index),
finalValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod( animatorDurationSeconds ) );
// Start the animation
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
float targetValue(50.0f);
float relativeValue(targetValue - startValue);
- animation.AnimateTo(Property(actor, "test-property"), targetValue);
+ animation.AnimateTo(Property(actor, "testProperty"), targetValue);
float ninetyFivePercentProgress(startValue + relativeValue*0.95f);
END_TEST;
}
-int UtcDaliAnimationAnimateToFloatAlphaFunctioN(void)
+int UtcDaliAnimationAnimateToFloatAlphaFunctionP(void)
{
TestApplication application;
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
float targetValue(90.0f);
float relativeValue(targetValue - startValue);
- animation.AnimateTo(Property(actor, index), targetValue, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(actor, index), targetValue, AlphaFunction::EASE_OUT);
float ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateTo(Property(actor, index),
targetValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register an integer property
int startValue(10);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
int targetValue(50);
int relativeValue(targetValue - startValue);
- animation.AnimateTo(Property(actor, "test-property"), targetValue);
+ animation.AnimateTo(Property(actor, "testProperty"), targetValue);
int ninetyFivePercentProgress(static_cast<int>(startValue + relativeValue*0.95f + 0.5f));
END_TEST;
}
-int UtcDaliAnimationAnimateToIntegerAlphaFunctioN(void)
+int UtcDaliAnimationAnimateToIntegerAlphaFunctionP(void)
{
TestApplication application;
// Register an integer property
int startValue(10);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
int targetValue(90);
int relativeValue(targetValue - startValue);
- animation.AnimateTo(Property(actor, index), targetValue, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(actor, index), targetValue, AlphaFunction::EASE_OUT);
int ninetyFivePercentProgress(static_cast<int>(startValue + relativeValue*0.95f + 0.5f));
// Register an integer property
int startValue(10);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateTo(Property(actor, index),
targetValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register a Vector2 property
Vector2 startValue(-50.0f, -50.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateToVector2AlphaFunctioN(void)
+int UtcDaliAnimationAnimateToVector2AlphaFunctionP(void)
{
TestApplication application;
// Register a Vector2 property
Vector2 startValue(1000.0f, 1000.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
Vector2 targetValue(9000.0f, 9000.0f);
Vector2 relativeValue(targetValue - startValue);
- animation.AnimateTo(Property(actor, "test-property"), targetValue, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(actor, "testProperty"), targetValue, AlphaFunction::EASE_OUT);
Vector2 ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateTo(Property(actor, index),
targetValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register a Vector3 property
Vector3 startValue(-50.0f, -50.0f, -50.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateToVector3AlphaFunctioN(void)
+int UtcDaliAnimationAnimateToVector3AlphaFunctionP(void)
{
TestApplication application;
// Register a Vector3 property
Vector3 startValue(1000.0f, 1000.0f, 1000.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
Vector3 targetValue(9000.0f, 9000.0f, 9000.0f);
Vector3 relativeValue(targetValue - startValue);
- animation.AnimateTo(Property(actor, index), targetValue, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(actor, index), targetValue, AlphaFunction::EASE_OUT);
Vector3 ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
Vector3 targetValue(30.0f, 30.0f, 30.0f);
Vector3 relativeValue(targetValue - startValue);
float delay = 0.5f;
- animation.AnimateTo(Property(actor, "test-property"),
+ animation.AnimateTo(Property(actor, "testProperty"),
targetValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
Vector3 targetValue(30.0f, 30.0f, 10.0f);
Vector3 relativeValue(targetValue - startValue);
float delay = 0.5f;
- animation.AnimateTo(Property(actor, "test-property", 0),
+ animation.AnimateTo(Property(actor, "testProperty", 0),
30.0f,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
animation.AnimateTo(Property(actor, index, 1),
30.0f,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
// Register a Vector4 property
Vector4 startValue(-50.0f, -40.0f, -30.0f, -20.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationAnimateToVector4AlphaFunctioN(void)
+int UtcDaliAnimationAnimateToVector4AlphaFunctionP(void)
{
TestApplication application;
// Register a Vector4 property
Vector4 startValue(1000.0f, 1000.0f, 1000.0f, 1000.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
Animation animation = Animation::New(durationSeconds);
Vector4 targetValue(9000.0f, 9000.0f, 9000.0f, 9000.0f);
Vector4 relativeValue(targetValue - startValue);
- animation.AnimateTo(Property(actor, index), targetValue, AlphaFunctions::EaseOut);
+ animation.AnimateTo(Property(actor, index), targetValue, AlphaFunction::EASE_OUT);
Vector4 ninetyFivePercentProgress(startValue + relativeValue*0.95f);
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, VECTOR4_EPSILON, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
float delay = 0.5f;
animation.AnimateTo(Property(actor, index),
targetValue,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod(delay, durationSeconds - delay));
// Start the animation
END_TEST;
}
-int UtcDaliAnimationAnimateToActorParentOrigiN(void)
+int UtcDaliAnimationAnimateToActorParentOriginP(void)
{
TestApplication application;
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::Property::SIZE), targetSize, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::SIZE), targetSize, AlphaFunction::EASE_IN);
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::Property::SIZE), targetSize, AlphaFunctions::Linear, TimePeriod(delay, durationSeconds - delay));
+ animation.AnimateTo( Property(actor, Actor::Property::SIZE), targetSize, AlphaFunction::LINEAR, TimePeriod(delay, durationSeconds - delay));
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().width, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().height, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().depth, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetSize.x, AlphaFunctions::EaseIn );
- animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetSize.y, AlphaFunctions::EaseIn );
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetSize.x, AlphaFunction::EASE_IN );
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetSize.y, AlphaFunction::EASE_IN );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetSize.x, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
- animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetSize.y, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetSize.x, AlphaFunction::LINEAR, TimePeriod( delay, durationSeconds - delay ) );
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetSize.y, AlphaFunction::LINEAR, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationAnimateToActorPositioN(void)
+int UtcDaliAnimationAnimateToActorPositionP(void)
{
TestApplication application;
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().x, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().y, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().z, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
END_TEST;
}
-int UtcDaliAnimationAnimateToActorPositionAlphaFunctioN(void)
+int UtcDaliAnimationAnimateToActorPositionAlphaFunctionP(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(200.0f, 200.0f, 200.0f);
- animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::EaseIn);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::EASE_IN);
Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
float delay = 0.5f;
animation.AnimateTo( Property(actor, Actor::Property::POSITION),
targetPosition,
- AlphaFunctions::Linear,
+ AlphaFunction::LINEAR,
TimePeriod( delay, durationSeconds - delay ) );
Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
END_TEST;
}
-int UtcDaliAnimationAnimateToActorOrientationQuaternioN(void)
+int UtcDaliAnimationAnimateToActorOrientationQuaternionP(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationAnimateToActorOrientationAlphaFunctioN(void)
+int UtcDaliAnimationAnimateToActorOrientationAlphaFunctionP(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
- animation.AnimateTo( Property(actor, Actor::Property::ORIENTATION), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::ORIENTATION), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunction::EASE_IN);
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.25f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f*0.25f*0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.5f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f*0.5f*0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(0.75f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f*0.75f*0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
float delay(0.1f);
- animation.AnimateTo( Property(actor, Actor::Property::ORIENTATION), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunctions::EaseIn, TimePeriod(delay, durationSeconds - delay));
+ animation.AnimateTo( Property(actor, Actor::Property::ORIENTATION), AngleAxis(targetRotationDegrees, Vector3::YAXIS), AlphaFunction::EASE_IN, TimePeriod(delay, durationSeconds - delay));
// Start the animation
animation.Play();
application.SendNotification();
finishCheck.CheckSignalNotReceived();
float progress = max(0.0f, 0.25f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
progress = max(0.0f, 0.5f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
progress = max(0.0f, 0.75f - delay) / (1.0f - delay);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * AlphaFunctions::EaseIn(progress), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * progress*progress*progress, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::Property::SCALE), targetScale, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::SCALE), targetScale, AlphaFunction::EASE_IN);
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::Property::SCALE), targetScale, AlphaFunctions::Linear, TimePeriod(delay, durationSeconds - delay));
+ animation.AnimateTo( Property(actor, Actor::Property::SCALE), targetScale, AlphaFunction::LINEAR, TimePeriod(delay, durationSeconds - delay));
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::Property::COLOR), targetColor, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property(actor, Actor::Property::COLOR), targetColor, AlphaFunction::EASE_IN);
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a shorter animator duration
float animatorDuration = 0.5f;
animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, Actor::Property::COLOR), targetColor, AlphaFunctions::Linear, TimePeriod(animatorDuration));
+ animation.AnimateTo( Property(actor, Actor::Property::COLOR), targetColor, AlphaFunction::LINEAR, TimePeriod(animatorDuration));
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationAnimateToActorColorGreeN(void)
+int UtcDaliAnimationAnimateToActorColorGreenP(void)
{
TestApplication application;
DALI_TEST_EQUALS(keyFrames.GetType(), Property::NONE, TEST_LOCATION);
keyFrames.Add(0.0f, 0.1f);
+
+ DALI_TEST_EQUALS(keyFrames.GetType(), Property::FLOAT, TEST_LOCATION);
+
+ KeyFrames keyFrames2( keyFrames);
+ DALI_TEST_CHECK( keyFrames2 );
+ DALI_TEST_EQUALS(keyFrames2.GetType(), Property::FLOAT, TEST_LOCATION);
+
+ KeyFrames keyFrames3 = KeyFrames::New();
+ keyFrames3.Add(0.6f, true);
+ DALI_TEST_CHECK( keyFrames3 );
+ DALI_TEST_EQUALS(keyFrames3.GetType(), Property::BOOLEAN, TEST_LOCATION);
+
+ keyFrames3 = keyFrames;
+ DALI_TEST_CHECK( keyFrames3 );
+ DALI_TEST_EQUALS(keyFrames3.GetType(), Property::FLOAT, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliAnimationKeyFrames02P(void)
+{
+ TestApplication application;
+
+ KeyFrames keyFrames = KeyFrames::New();
+ DALI_TEST_EQUALS(keyFrames.GetType(), Property::NONE, TEST_LOCATION);
+
+ keyFrames.Add(0.0f, 0.1f);
keyFrames.Add(0.2f, 0.5f);
keyFrames.Add(0.4f, 0.0f);
keyFrames.Add(0.6f, 1.0f);
END_TEST;
}
-int UtcDaliAnimationKeyFrames02P(void)
+int UtcDaliAnimationKeyFrames03P(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationKeyFrames03P(void)
+int UtcDaliAnimationKeyFrames04P(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationKeyFrames04P(void)
+int UtcDaliAnimationKeyFrames05P(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationKeyFrames05P(void)
+int UtcDaliAnimationKeyFrames06P(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationKeyFrames06P(void)
+int UtcDaliAnimationKeyFrames07P(void)
{
TestApplication application;
END_TEST;
}
-int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctioN(void)
+int UtcDaliAnimationAnimateBetweenActorColorAlphaFunctionP(void)
{
TestApplication application;
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunctions::Linear );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR );
// Start the animation
animation.Play();
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunctions::Linear, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR, Animation::Cubic );
// Start the animation
animation.Play();
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR, TimePeriod( delay, durationSeconds - delay ) );
// Start the animation
animation.Play();
END_TEST;
}
-int P(void)
+int UtcDaliAnimationAnimateBetweenActorColorCubicWithDelayP(void)
{
TestApplication application;
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ), Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR, TimePeriod( delay, durationSeconds - delay ), Animation::Cubic );
// Start the animation
animation.Play();
END_TEST;
}
-int UtcDaliAnimationAnimateAlphaFunctioN(void)
+int UtcDaliAnimationAnimateAlphaFunctionP(void)
{
TestApplication application;
// Build the animation
float durationSeconds( 1.0f );
Animation animation = Animation::New(durationSeconds);
- animation.Animate(actor, path, Vector3::XAXIS, AlphaFunctions::Linear);
+ animation.Animate(actor, path, Vector3::XAXIS, AlphaFunction::LINEAR);
// Start the animation
animation.Play();
// Build the animation
float durationSeconds( 1.0f );
Animation animation = Animation::New(durationSeconds);
- animation.Animate(actor, path, Vector3::XAXIS, AlphaFunctions::Linear, TimePeriod(0.0f, 1.0f));
+ animation.Animate(actor, path, Vector3::XAXIS, AlphaFunction::LINEAR, TimePeriod(0.0f, 1.0f));
// Start the animation
animation.Play();
animation.FinishedSignal().Connect( &application, finishCheck );
Vector3 startValue(1.0f, 1.0f, 1.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Constraint constraint = Constraint::New<Vector3>( actor, index, UpdateManagerTestConstraint( application ) );
constraint.Apply();
// Apply animation to actor
- animation.AnimateTo( Property(actor, Actor::Property::POSITION), Vector3( 100.f, 90.f, 80.f ), AlphaFunctions::Linear );
+ animation.AnimateTo( Property(actor, Actor::Property::POSITION), Vector3( 100.f, 90.f, 80.f ), AlphaFunction::LINEAR );
animation.Play();
animation2.FinishedSignal().Connect( &application, AnimationFinishCheck( signal2Received ) );
// Apply animations to actor
- animation1.AnimateTo( Property(actor, Actor::Property::POSITION), Vector3( 3.0f, 2.0f, 1.0f ), AlphaFunctions::Linear );
+ animation1.AnimateTo( Property(actor, Actor::Property::POSITION), Vector3( 3.0f, 2.0f, 1.0f ), AlphaFunction::LINEAR );
animation1.Play();
- animation2.AnimateTo( Property(actor, Actor::Property::SIZE ), Vector3( 10.0f, 20.0f, 30.0f ), AlphaFunctions::Linear );
+ animation2.AnimateTo( Property(actor, Actor::Property::SIZE ), Vector3( 10.0f, 20.0f, 30.0f ), AlphaFunction::LINEAR );
animation2.Play();
DALI_TEST_EQUALS( signal1Received, false, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationExtendDuratioN(void)
+int UtcDaliAnimationExtendDurationP(void)
{
TestApplication application;
// Register a float property
float startValue(10.0f);
- Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Property::Index index = actor.RegisterProperty( "testProperty", startValue );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(index), targetValue, TEST_LOCATION );
END_TEST;
}
+
+int UtcDaliAnimationCustomIntProperty(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+ int startValue(0u);
+
+ Property::Index index = actor.RegisterProperty("anIndex", startValue);
+ DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ animation.AnimateTo( Property(actor, index), 20 );
+
+ // 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.GetProperty<int>(index), 10, 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.GetProperty<int>(index), 20, TEST_LOCATION );
+ END_TEST;
+}