// Add a child
Actor child = NewRelayoutActor( true, true, FILL_TO_PARENT, FIXED );
- child.SetDimensionDependency( HEIGHT, WIDTH );
+ child.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
parent.Add( child );
// Run the test
namespace
{
-// Enumeration properties to test:
-const Scripting::StringEnum< int > SIZE_MODE_VALUES[] =
-{
- { "USE_OWN_SIZE", USE_OWN_SIZE },
- { "SIZE_RELATIVE_TO_PARENT", SIZE_RELATIVE_TO_PARENT },
- { "SIZE_FIXED_OFFSET_FROM_PARENT", SIZE_FIXED_OFFSET_FROM_PARENT },
-};
-const unsigned int SIZE_MODE_VALUES_COUNT = sizeof( SIZE_MODE_VALUES ) / sizeof( SIZE_MODE_VALUES[0] );
-
bool gTouchCallBackCalled=false;
bool gTouchCallBack2Called=false;
bool gHoverCallBackCalled=false;
Stage::GetCurrent().Add(a);
Stage::GetCurrent().Add(b);
- a.SetResizePolicy( FIXED, ALL_DIMENSIONS );
- a.SetPreferredSize(Vector2(100.0f, 100.0f));
- b.SetResizePolicy( FIXED, ALL_DIMENSIONS );
- b.SetPreferredSize(Vector2(100.0f, 100.0f));
+ a.SetSize( 100.0f, 100.0f );
+ b.SetSize( 100.0f, 100.0f );
// position b overlapping a. (regular non-overlays)
// hit test at point 'x'
{ "color-mode", Actor::Property::COLOR_MODE, Property::STRING },
{ "position-inheritance", Actor::Property::POSITION_INHERITANCE, Property::STRING },
{ "draw-mode", Actor::Property::DRAW_MODE, Property::STRING },
- { "size-mode", Actor::Property::SIZE_MODE, Property::STRING },
{ "size-mode-factor", Actor::Property::SIZE_MODE_FACTOR, Property::VECTOR3 },
{ "relayout-enabled", Actor::Property::RELAYOUT_ENABLED, Property::BOOLEAN },
{ "width-resize-policy", Actor::Property::WIDTH_RESIZE_POLICY, Property::STRING },
{ "padding", Actor::Property::PADDING, Property::VECTOR4 },
{ "minimum-size", Actor::Property::MINIMUM_SIZE, Property::VECTOR2 },
{ "maximum-size", Actor::Property::MAXIMUM_SIZE, Property::VECTOR2 },
- { "preferred-size", Actor::Property::PREFERRED_SIZE, Property::VECTOR2 },
};
const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] );
} // unnamed namespace
// Start the animation
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
animation.Play();
bool signalReceived(false);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.SetLooping(true);
DALI_TEST_CHECK(animation.GetEndAction() == Animation::Bake);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BakeFinal);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
animation.SetDisconnectAction( Animation::Bake );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
animation.SetDisconnectAction( Animation::Discard );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*0.5f*1000.0f)/*Only half the animation*/);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
Animation animation = Animation::New(durationSeconds);
animation.SetDisconnectAction( Animation::Discard );
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::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.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Start the animation
animation.Play();
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
//PlayFrom with an argument outside the range [0..1] will be ignored
animation.PlayFrom(-1.0f);
application.SendNotification();
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
//Trying to set the current cursor outside the range [0..1] is ignored
animation.SetCurrentProgress( -1.0f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
Vector3 fiftyPercentProgress(targetPosition * 0.5f);
finishCheck.Reset();
actor.SetPosition(Vector3::ZERO);
Vector3 targetScale(3.0f, 3.0f, 3.0f);
- animation.ScaleTo(actor, targetScale, AlphaFunctions::Linear);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunctions::Linear );
animation.Play();
application.SendNotification();
}
-int UtcDaliAnimationMoveByFloat3(void)
+int UtcDaliAnimationAnimateByPropertyPositionVector3(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
- animation.MoveBy(actor, relativePosition.x, relativePosition.y, relativePosition.z);
+ animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( relativePosition.x, relativePosition.y, relativePosition.z ) );
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
END_TEST;
}
-int UtcDaliAnimationMoveByVector3Alpha(void)
+int UtcDaliAnimationAnimateByPropertyPositionVector3Alpha(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
- animation.MoveBy(actor, relativePosition, AlphaFunctions::EaseOut);
+ animation.AnimateBy( Property( actor, Actor::Property::POSITION ), relativePosition, AlphaFunctions::EaseOut );
Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
END_TEST;
}
-int UtcDaliAnimationMoveByVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateByPropertyPositionVector3AlphaTimePeriod(void)
{
TestApplication application;
Vector3 targetPosition(20.0f, 20.0f, 20.0f);
Vector3 relativePosition(targetPosition - startPosition);
float delay = 0.5f;
- animation.MoveBy(actor, relativePosition, AlphaFunctions::Linear, delay, durationSeconds - delay);
-
- Vector3 ninetyFivePercentProgress(startPosition + relativePosition*0.95f);
-
- // 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% animation progress, 0% animator progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), startPosition, 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(), targetPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationMoveToFloat3(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.MoveTo(actor, targetPosition.x, targetPosition.y, targetPosition.z);
-
- 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 UtcDaliAnimationMoveToVector3Alpha(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.MoveTo(actor, 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 UtcDaliAnimationMoveToVector3AlphaFloat2(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.MoveTo(actor, targetPosition, AlphaFunctions::Linear, delay, durationSeconds - delay);
-
- 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*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.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*500.0f*0.75)/* 7/8 animation progress, 3/4 animator 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*500.0f*0.25) + 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 UtcDaliAnimationRotateByDegreeVector3(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationDegrees/*Degree version*/, Vector3::YAXIS);
-
- // 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*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 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 * 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 * 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*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByRadianVector3(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationRadians/*Radian version*/, Vector3::YAXIS);
-
- // 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*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians * 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 * 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 * 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*/);
-
- // We did expect the animation to finish
- application.SendNotification();
- finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByDegreeVector3Alpha(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
-
- // 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*250.0f)/* 25% progress */);
-
- // 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 );
-
- 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 );
-
- 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 );
-
- 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.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByRadianVector3Alpha(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- animation.RotateBy(actor, relativeRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
-
- // 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*250.0f)/* 25% progress */);
-
- // 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 );
-
- 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 );
-
- 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 );
-
- 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.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateByDegreeVector3AlphaFloat2(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- float delay = 0.3f;
- animation.RotateBy(actor, relativeRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ animation.AnimateBy( Property( actor, Actor::Property::POSITION ), relativePosition, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- 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 );
-
- 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();
- 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 );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
+ 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();
- 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.GetCurrentPosition(), startPosition, TEST_LOCATION );
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f) + 1u/*just beyond the animation duration*/);
+ 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.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-
-int UtcDaliAnimationRotateByRadianVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyPositionVector3(void)
{
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree relativeRotationDegrees(360.0f);
- Radian relativeRotationRadians(relativeRotationDegrees);
- float delay = 0.3f;
- animation.RotateBy(actor, relativeRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
-
- // 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*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- 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 );
-
- 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();
- 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 );
-
- 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();
- 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 );
-
- 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.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliAnimationRotateToDegreeVector3(void)
-{
- TestApplication application;
-
- Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
- Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ Vector3 targetPosition(200.0f, 200.0f, 200.0f);
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( targetPosition.x, targetPosition.y, targetPosition.z ) );
- // Build the animation
- float durationSeconds(1.0f);
- Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationDegrees/*Degree version*/, Vector3::YAXIS);
+ Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 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 * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
+ 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.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ 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.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToRadianVector3(void)
+int UtcDaliAnimationAnimateToPropertyPositionVector3Alpha(void)
{
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationRadians/*Radian version*/, Vector3::YAXIS);
+ Vector3 targetPosition(200.0f, 200.0f, 200.0f);
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunctions::EaseIn );
+
+ Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
+ 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.GetCurrentOrientation(), Quaternion(targetRotationRadians * 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 * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ // 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.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToQuaternion(void)
+int UtcDaliAnimationAnimateToPropertyPositionVector3AlphaTimePeriod(void)
{
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion(0.0f, Vector3::YAXIS));
Stage::GetCurrent().Add(actor);
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
- animation.RotateTo(actor, targetRotation/*Quaternion version*/);
+ Vector3 targetPosition(200.0f, 200.0f, 200.0f);
+ float delay = 0.5f;
+ animation.AnimateTo( Property( actor, Actor::Property::POSITION ), targetPosition, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
+
+ Vector3 seventyFivePercentProgress(targetPosition * 0.75f);
// Start the animation
animation.Play();
animation.FinishedSignal().Connect(&application, finishCheck);
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 25% progress */);
-
- // We didn't expect the animation to finish yet
- application.SendNotification();
- finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.25f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 50% progress */);
+ 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.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.5f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), Vector3::ZERO, TEST_LOCATION );
application.SendNotification();
- application.Render(static_cast<unsigned int>(durationSeconds*250.0f)/* 75% progress */);
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f*0.75)/* 7/8 animation progress, 3/4 animator progress */);
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians * 0.75f, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ 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*/);
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f*0.25) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToDegreeVector3Alpha(void)
+int UtcDaliAnimationAnimateByPropertyOrientationQuaternion(void)
{
TestApplication application;
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
+ Degree relativeRotationDegrees(360.0f);
+ Radian relativeRotationRadians(relativeRotationDegrees);
+ animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ) );
// 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(relativeRotationRadians * 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(relativeRotationRadians * 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(relativeRotationRadians * 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*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToRadianVector3Alpha(void)
+int UtcDaliAnimationAnimateByPropertyOrientationQuaternionAlpha(void)
{
TestApplication application;
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- animation.RotateTo(actor, targetRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn);
+ Degree relativeRotationDegrees(360.0f);
+ Radian relativeRotationRadians(relativeRotationDegrees);
+ animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ), AlphaFunctions::EaseIn );
// 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(relativeRotationRadians * AlphaFunctions::EaseIn(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(relativeRotationRadians * AlphaFunctions::EaseIn(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(relativeRotationRadians * AlphaFunctions::EaseIn(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*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToQuaternionAlpha(void)
+int UtcDaliAnimationAnimateByPropertyOrientationQuaternionAlphaTimePeriod(void)
{
TestApplication application;
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- Degree targetRotationDegrees(90.0f);
- Radian targetRotationRadians(targetRotationDegrees);
- Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
- animation.RotateTo(actor, targetRotation/*Quaternion version*/, AlphaFunctions::EaseIn);
+ Degree relativeRotationDegrees(360.0f);
+ Radian relativeRotationRadians(relativeRotationDegrees);
+ float delay = 0.3f;
+ animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::YAXIS ),
+ AlphaFunctions::EaseIn, TimePeriod( delay, durationSeconds - delay ) );
// 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 );
+ 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 );
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 );
+ 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 );
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 );
+ 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 );
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.GetCurrentOrientation(), Quaternion(targetRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentOrientation(), Quaternion(relativeRotationRadians, Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
END_TEST;
}
-int UtcDaliAnimationRotateToDegreeVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyOrientationQuaternion(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
- float delay(0.1f);
- animation.RotateTo(actor, targetRotationDegrees/*Degree version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
+ animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), targetRotation );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
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 * 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();
- 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 * 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();
- 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 * 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*/);
END_TEST;
}
-int UtcDaliAnimationRotateToRadianVector3AlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyOrientationQuaternionAlpha(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Degree targetRotationDegrees(90.0f);
Radian targetRotationRadians(targetRotationDegrees);
- float delay(0.1f);
- animation.RotateTo(actor, targetRotationRadians/*Radian version*/, Vector3::YAXIS, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
+ animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), targetRotation, AlphaFunctions::EaseIn );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
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 * AlphaFunctions::EaseIn(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();
- 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 * AlphaFunctions::EaseIn(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();
- 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 * AlphaFunctions::EaseIn(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*/);
END_TEST;
}
-int UtcDaliAnimationRotateToQuaternionAlphaFloat2(void)
+int UtcDaliAnimationAnimateToPropertyOrientationQuaternionAlphaTimePeriod(void)
{
TestApplication application;
Radian targetRotationRadians(targetRotationDegrees);
float delay(0.1f);
Quaternion targetRotation(targetRotationRadians, Vector3::YAXIS);
- animation.RotateTo(actor, targetRotation/*Quaternion version*/, AlphaFunctions::EaseIn, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), targetRotation, AlphaFunctions::EaseIn, TimePeriod( delay, durationSeconds - delay ) );
// Start the animation
animation.Play();
END_TEST;
}
-int UtcDaliAnimationScaleBy(void)
+int UtcDaliAnimationAnimateByPropertyScale(void)
{
TestApplication application;
Animation animation = Animation::New(durationSeconds);
Vector3 targetScale(2.0f, 2.0f, 2.0f);
Vector3 relativeScale(targetScale - Vector3::ONE);
- animation.ScaleBy(actor, relativeScale.x, relativeScale.y, relativeScale.z);
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), Vector3( relativeScale.x, relativeScale.y, relativeScale.z ) );
Vector3 ninetyNinePercentProgress(Vector3::ONE + relativeScale*0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.ScaleBy(actor, relativeScale, AlphaFunctions::EaseIn);
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.ScaleBy(actor, relativeScale, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateBy( Property( actor, Actor::Property::SCALE ), relativeScale, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationScaleTo(void)
+int UtcDaliAnimationAnimateToPropertyScale(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetScale(2.0f, 2.0f, 2.0f);
- animation.ScaleTo(actor, targetScale.x, targetScale.y, targetScale.z);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale );
Vector3 ninetyNinePercentProgress(Vector3::ONE + (targetScale - Vector3::ONE)*0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.ScaleTo(actor, targetScale, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.ScaleTo(actor, targetScale, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::SCALE ), targetScale, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationOpacityTo(void)
+int UtcDaliAnimationAnimateToPropertyColorAlpha(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
float targetOpacity(0.0f);
- animation.OpacityTo(actor, targetOpacity);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), targetOpacity );
float ninetyNinePercentProgress(0.01f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.OpacityTo(actor, targetOpacity, AlphaFunctions::EaseIn);
+ animation.AnimateTo(Property( actor, Actor::Property::COLOR_ALPHA ), targetOpacity, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.OpacityTo(actor, targetOpacity, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR_ALPHA ), targetOpacity, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationColorTo(void)
+int UtcDaliAnimationAnimateToPropertyColor(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector4 targetColor(Color::RED);
- animation.ColorTo(actor, targetColor);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR ), targetColor );
Vector4 tenPercentProgress(Vector4(1.0f, 0.9f, 0.9f, 1.0f));
Vector4 twentyPercentProgress(Vector4(1.0f, 0.8f, 0.8f, 1.0f));
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.ColorTo(actor, targetColor, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR ), targetColor, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a shorter animator duration
float animatorDuration = 0.5f;
animation = Animation::New(durationSeconds);
- animation.ColorTo(actor, targetColor, AlphaFunctions::Linear, 0, animatorDuration);
+ animation.AnimateTo( Property( actor, Actor::Property::COLOR ), targetColor, AlphaFunctions::Linear, TimePeriod( 0, animatorDuration ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationResize(void)
+int UtcDaliAnimationAnimateToPropertySize(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetSize(100.0f, 100.0f, 100.0f);
- animation.Resize(actor, targetSize);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize);
Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize, AlphaFunctions::EaseIn);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize, AlphaFunctions::Linear, TimePeriod( delay, durationSeconds - delay ) );
animation.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
END_TEST;
}
-int UtcDaliAnimationResizeByXY(void)
+int UtcDaliAnimationAnimateToPropertySizeByXY(void)
{
TestApplication application;
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
Vector3 targetSize(100.0f, 100.0f, 100.0f);
- animation.Resize(actor, targetSize);
+ animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetSize );
Vector3 ninetyNinePercentProgress(targetSize * 0.99f);
// Repeat with a different (ease-in) alpha function
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize.x, targetSize.y, AlphaFunctions::EaseIn);
+ 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.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
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 );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().x, targetSize.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().y, targetSize.y, TEST_LOCATION );
// Reset everything
finishCheck.Reset();
// Repeat with a delay
float delay = 0.5f;
animation = Animation::New(durationSeconds);
- animation.Resize(actor, targetSize.x, targetSize.y, AlphaFunctions::Linear, delay, durationSeconds - delay);
+ 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.FinishedSignal().Connect(&application, finishCheck);
animation.Play();
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetCurrentSize(), targetSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().x, targetSize.x, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetCurrentSize().y, targetSize.y, TEST_LOCATION );
END_TEST;
}
-
int UtcDaliAnimationAnimateBetweenActorColorTimePeriod(void)
{
TestApplication application;
DALI_TEST_EQUALS(animation.GetDuration(), durationSeconds, TEST_LOCATION);
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- animation.MoveTo(actor, targetPosition, AlphaFunctions::Linear);
+ animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunctions::Linear);
// Set the new duration to be 2 seconds
float newDurationSeconds(2.0f);
DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
Animation anim = Animation::New( 1.0f );
- anim.Resize( custom, Vector3( 8.0f, 9.0f, 10.0f ) );
+ anim.AnimateTo( Property( custom, Actor::Property::SIZE ), Vector3( 8.0f, 9.0f, 10.0f ) );
DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
DALI_TEST_EQUALS( 8.0f, custom.GetTargetSize().width, TEST_LOCATION );
DALI_TEST_EQUALS( 9.0f, custom.GetTargetSize().height, TEST_LOCATION );
DALI_TEST_EQUALS( 10.0f, custom.GetTargetSize().depth, TEST_LOCATION );
-
- anim.Resize( custom, 1.0f, 2.0f );
- DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
- DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION );
- DALI_TEST_EQUALS( 1.0f, custom.GetTargetSize().width, TEST_LOCATION );
- DALI_TEST_EQUALS( 2.0f, custom.GetTargetSize().height, TEST_LOCATION );
END_TEST;
}
DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::COLOR_MODE ) );
DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::POSITION_INHERITANCE ) );
DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::DRAW_MODE ) );
- DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::SIZE_MODE ) );
DALI_TEST_CHECK( false == actor.IsPropertyAConstraintInput( Actor::Property::SIZE_MODE_FACTOR ) );
END_TEST;
application.Render(16);
DALI_TEST_CHECK( application.GetPlatform().WasCalled(TestPlatformAbstraction::LoadResourceFunc) );
ImageActor actor = ImageActor::New(image);
- actor.SetPreferredSize( Vector2( 80, 80 ) );
- actor.SetResizePolicy( FIXED, ALL_DIMENSIONS );
+ actor.SetSize( 80, 80 );
application.SendNotification();
application.Render(16);
return actor;
actor.SetLeaveRequired( true );
actor.SetInheritOrientation( false );
actor.SetInheritScale( false );
- actor.SetSizeMode( USE_OWN_SIZE );
actor.SetSizeModeFactor( Vector3::ONE );
Stage::GetCurrent().Add( actor );
#include <dali/internal/event/render-tasks/render-task-list-impl.h>
#include <dali/internal/event/common/property-helper.h>
#include <dali/internal/event/common/stage-impl.h>
+#include <dali/internal/event/common/type-info-impl.h>
#include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
#include <dali/internal/event/animation/constraint-impl.h>
#include <dali/internal/event/common/projection.h>
struct Actor::RelayoutData
{
RelayoutData()
- : sizeModeFactor( Vector3::ONE ), preferredSize( Vector2::ZERO ), sizeSetPolicy( USE_SIZE_SET ), sizeMode( USE_OWN_SIZE ), relayoutEnabled( false ), insideRelayout( false )
+ : sizeModeFactor( Vector3::ONE ), preferredSize( Vector2::ZERO ), sizeSetPolicy( USE_SIZE_SET ), relayoutEnabled( false ), insideRelayout( false )
{
// Set size negotiation defaults
for( unsigned int i = 0; i < DIMENSION_COUNT; ++i )
Vector2 preferredSize; ///< The preferred size of the actor
SizeScalePolicy sizeSetPolicy :3; ///< Policy to apply when setting size. Enough room for the enum
- SizeMode sizeMode :2; ///< Determines how the actors parent affects the actors size
bool relayoutEnabled :1; ///< Flag to specify if this actor should be included in size negotiation or not (defaults to true)
bool insideRelayout :1; ///< Locking flag to prevent recursive relayouts on size set
DALI_PROPERTY( "color-mode", STRING, true, false, false, Dali::Actor::Property::COLOR_MODE )
DALI_PROPERTY( "position-inheritance", STRING, true, false, false, Dali::Actor::Property::POSITION_INHERITANCE )
DALI_PROPERTY( "draw-mode", STRING, true, false, false, Dali::Actor::Property::DRAW_MODE )
-DALI_PROPERTY( "size-mode", STRING, true, false, false, Dali::Actor::Property::SIZE_MODE )
DALI_PROPERTY( "size-mode-factor", VECTOR3, true, false, false, Dali::Actor::Property::SIZE_MODE_FACTOR )
DALI_PROPERTY( "relayout-enabled", BOOLEAN, true, false, false, Dali::Actor::Property::RELAYOUT_ENABLED )
DALI_PROPERTY( "width-resize-policy", STRING, true, false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY )
DALI_PROPERTY( "padding", VECTOR4, true, false, false, Dali::Actor::Property::PADDING )
DALI_PROPERTY( "minimum-size", VECTOR2, true, false, false, Dali::Actor::Property::MINIMUM_SIZE )
DALI_PROPERTY( "maximum-size", VECTOR2, true, false, false, Dali::Actor::Property::MAXIMUM_SIZE )
-DALI_PROPERTY( "preferred-size", VECTOR2, true, false, false, Dali::Actor::Property::PREFERRED_SIZE )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
// Signals
// Enumeration to / from string conversion tables
-DALI_ENUM_TO_STRING_TABLE_BEGIN( SizeMode )DALI_ENUM_TO_STRING( USE_OWN_SIZE )
-DALI_ENUM_TO_STRING( SIZE_RELATIVE_TO_PARENT )
-DALI_ENUM_TO_STRING( SIZE_FIXED_OFFSET_FROM_PARENT )
-DALI_ENUM_TO_STRING_TABLE_END( SizeMode )
-
DALI_ENUM_TO_STRING_TABLE_BEGIN( ResizePolicy )DALI_ENUM_TO_STRING( FIXED )
DALI_ENUM_TO_STRING( USE_NATURAL_SIZE )
-DALI_ENUM_TO_STRING( USE_ASSIGNED_SIZE )
DALI_ENUM_TO_STRING( FILL_TO_PARENT )
+DALI_ENUM_TO_STRING( SIZE_RELATIVE_TO_PARENT )
+DALI_ENUM_TO_STRING( SIZE_FIXED_OFFSET_FROM_PARENT )
DALI_ENUM_TO_STRING( FIT_TO_CHILDREN )
DALI_ENUM_TO_STRING( DIMENSION_DEPENDENCY )
+DALI_ENUM_TO_STRING( USE_ASSIGNED_SIZE )
DALI_ENUM_TO_STRING_TABLE_END( ResizePolicy )
DALI_ENUM_TO_STRING_TABLE_BEGIN( SizeScalePolicy )DALI_ENUM_TO_STRING( USE_SIZE_SET )
return mInheritOrientation;
}
-void Actor::SetSizeMode( SizeMode mode )
-{
- EnsureRelayoutData();
-
- mRelayoutData->sizeMode = mode;
-}
-
void Actor::SetSizeModeFactor( const Vector3& factor )
{
EnsureRelayoutData();
mRelayoutData->sizeModeFactor = factor;
}
-SizeMode Actor::GetSizeMode() const
-{
- EnsureRelayoutData();
-
- return mRelayoutData->sizeMode;
-}
-
const Vector3& Actor::GetSizeModeFactor() const
{
EnsureRelayoutData();
}
}
+ if( policy == DIMENSION_DEPENDENCY )
+ {
+ if( dimension & WIDTH )
+ {
+ SetDimensionDependency( WIDTH, HEIGHT );
+ }
+
+ if( dimension & HEIGHT )
+ {
+ SetDimensionDependency( HEIGHT, WIDTH );
+ }
+ }
+
OnSetResizePolicy( policy, dimension );
// Trigger relayout on this control
if( dimension & ( 1 << i ) )
{
mRelayoutData->dimensionDependencies[ i ] = dependency;
- mRelayoutData->resizePolicies[ i ] = DIMENSION_DEPENDENCY;
}
}
}
break;
}
- case Dali::Actor::Property::SIZE_MODE:
- {
- SetSizeMode( Scripting::GetEnumeration< SizeMode >( property.Get< std::string >().c_str(), SizeModeTable, SizeModeTableCount ) );
- break;
- }
-
case Dali::Actor::Property::SIZE_MODE_FACTOR:
{
SetSizeModeFactor( property.Get< Vector3 >() );
{
if( property.Get< bool >() )
{
- SetDimensionDependency( WIDTH, HEIGHT );
+ SetResizePolicy( DIMENSION_DEPENDENCY, WIDTH );
}
break;
}
{
if( property.Get< bool >() )
{
- SetDimensionDependency( HEIGHT, WIDTH );
+ SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
}
break;
}
break;
}
- case Dali::Actor::Property::PREFERRED_SIZE:
- {
- Vector2 size = property.Get< Vector2 >();
- SetPreferredSize( size );
- break;
- }
-
default:
{
// this can happen in the case of a non-animatable default property so just do nothing
break;
}
- case Dali::Actor::Property::SIZE_MODE:
- {
- value = Scripting::GetLinearEnumerationName< SizeMode >( GetSizeMode(), SizeModeTable, SizeModeTableCount );
- break;
- }
-
case Dali::Actor::Property::SIZE_MODE_FACTOR:
{
value = GetSizeModeFactor();
break;
}
- case Dali::Actor::Property::PREFERRED_SIZE:
- {
- value = GetPreferredSize();
- break;
- }
-
default:
{
DALI_ASSERT_ALWAYS( false && "Actor Property index invalid" ); // should not come here
if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
{
AnimatablePropertyMetadata* animatable = FindAnimatableProperty( index );
+ if( !animatable )
+ {
+ const TypeInfo* typeInfo( GetTypeInfo() );
+ if ( typeInfo )
+ {
+ if( Property::INVALID_INDEX != RegisterSceneGraphProperty( typeInfo->GetPropertyName( index ), index, Property::Value( typeInfo->GetPropertyType( index ) ) ) )
+ {
+ animatable = FindAnimatableProperty( index );
+ }
+ }
+ }
DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
+
property = animatable->GetSceneGraphProperty();
}
else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
if ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX && index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX )
{
AnimatablePropertyMetadata* animatable = FindAnimatableProperty( index );
+ if( !animatable )
+ {
+ const TypeInfo* typeInfo( GetTypeInfo() );
+ if ( typeInfo )
+ {
+ if( Property::INVALID_INDEX != RegisterSceneGraphProperty( typeInfo->GetPropertyName( index ), index, Property::Value( typeInfo->GetPropertyType( index ) ) ) )
+ {
+ animatable = FindAnimatableProperty( index );
+ }
+ }
+ }
DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
+
property = animatable->GetSceneGraphProperty();
}
else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
if( ( dimension & ( 1 << i ) ) )
{
const ResizePolicy resizePolicy = GetResizePolicy( static_cast< Dimension >( 1 << i ) );
- if( resizePolicy == FILL_TO_PARENT )
+ if( resizePolicy == FILL_TO_PARENT || resizePolicy == SIZE_RELATIVE_TO_PARENT || resizePolicy == SIZE_FIXED_OFFSET_FROM_PARENT )
{
return true;
}
float Actor::CalculateChildSizeBase( const Dali::Actor& child, Dimension dimension )
{
// Fill to parent, taking size mode factor into account
- switch( child.GetSizeMode() )
+ switch( child.GetResizePolicy( dimension ) )
{
- case USE_OWN_SIZE:
+ case FILL_TO_PARENT:
{
return GetLatestSize( dimension );
}
}
case FILL_TO_PARENT:
+ case SIZE_RELATIVE_TO_PARENT:
+ case SIZE_FIXED_OFFSET_FROM_PARENT:
{
return NegotiateFromParent( dimension );
}
{
EnsureRelayoutData();
+ if( size.width > 0.0f )
+ {
+ SetResizePolicy( FIXED, WIDTH );
+ }
+
+ if( size.height > 0.0f )
+ {
+ SetResizePolicy( FIXED, HEIGHT );
+ }
+
mRelayoutData->preferredSize = size;
RelayoutRequest();
bool IsOrientationInherited() const;
/**
- * @brief Defines how a child actors size is affected by its parents size.
- * @param[in] mode The size relative to parent mode to use.
- */
- void SetSizeMode( SizeMode mode );
-
- /**
- * Query how the child actors size is affected by its parents size.
- * @return The size relative to parent mode in use.
- */
- SizeMode GetSizeMode() const;
-
- /**
* Sets the factor of the parents size used for the child actor.
- * Note: Only used if SizeMode is SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT.
+ * Note: Only used if ResizePolicy is SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT.
* @param[in] factor The vector to multiply the parents size by to get the childs size.
*/
void SetSizeModeFactor( const Vector3& factor );
/**
* Gets the factor of the parents size used for the child actor.
- * Note: Only used if SizeMode is SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT.
+ * Note: Only used if ResizePolicy is SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT.
* @return The vector being used to multiply the parents size by to get the childs size.
*/
const Vector3& GetSizeModeFactor() const;
float CalculateChildSizeBase( const Dali::Actor& child, Dimension dimension );
/**
- * @copydoc Dali::Actor::SetPreferredSize
+ * @brief Set the preferred size for size negotiation
+ *
+ * @param[in] size The preferred size to set
*/
void SetPreferredSize( const Vector2& size );
/**
- * @copydoc Dali::Actor::GetPreferredSize
+ * @brief Return the preferred size used for size negotiation
+ *
+ * @return Return the preferred size
*/
Vector2 GetPreferredSize() const;
{
mInternalSetSize = true;
SetSize( image->GetNaturalSize() );
- SetPreferredSize( GetTargetSize().GetVectorXY() );
mInternalSetSize = false;
}
}
{
mInternalSetSize = true;
SetSize( CalculateNaturalSize() );
- SetPreferredSize( GetTargetSize().GetVectorXY() );
mInternalSetSize = false;
}
}
}
}
-void Animation::MoveBy(Actor& actor, float x, float y, float z)
-{
- MoveBy(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveBy(Actor& actor, const Vector3& displacement, AlphaFunction alpha)
-{
- MoveBy(actor, displacement, alpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveBy(Actor& actor, const Vector3& displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::Property::POSITION,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateByVector3(displacement),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::MoveTo(Actor& actor, float x, float y, float z)
-{
- MoveTo(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveTo(Actor& actor, const Vector3& position, AlphaFunction alpha)
-{
- MoveTo(actor, position, alpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveTo(Actor& actor, const Vector3& position, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::Property::POSITION,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateToVector3(position),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis)
-{
- RotateBy(actor, angle, axis, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha)
-{
- RotateBy(actor, angle, axis, alpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
- Dali::Actor::Property::ORIENTATION,
- Property::INVALID_COMPONENT_INDEX,
- new RotateByAngleAxis(angle, axis),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::RotateTo(Actor& actor, Radian angle, const Vector3& axis)
-{
- Vector4 normalizedAxis(axis.x, axis.y, axis.z, 0.0f);
- normalizedAxis.Normalize();
-
- Quaternion orientation(Quaternion::FromAxisAngle(normalizedAxis, angle));
-
- RotateTo(actor, orientation, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, const Quaternion& orientation)
-{
- RotateTo(actor, orientation, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha)
-{
- Vector4 normalizedAxis(axis.x, axis.y, axis.z, 0.0f);
- normalizedAxis.Normalize();
-
- Quaternion orientation(Quaternion::FromAxisAngle(normalizedAxis, angle));
-
- RotateTo(actor, orientation, alpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, const Quaternion& orientation, AlphaFunction alpha)
-{
- RotateTo(actor, orientation, alpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- Vector4 normalizedAxis(axis.x, axis.y, axis.z, 0.0f);
- normalizedAxis.Normalize();
-
- Quaternion orientation(Quaternion::FromAxisAngle(normalizedAxis, angle));
-
- RotateTo(actor, orientation, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor& actor, const Quaternion& rotation, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
- Dali::Actor::Property::ORIENTATION,
- Property::INVALID_COMPONENT_INDEX,
- new RotateToQuaternion(rotation),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ScaleBy(Actor& actor, float x, float y, float z)
-{
- ScaleBy(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha)
-{
- ScaleBy(actor, scale, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::Property::SCALE,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateByVector3(scale),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ScaleTo(Actor& actor, float x, float y, float z)
-{
- ScaleTo(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha)
-{
- ScaleTo(actor, scale, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::Property::SCALE,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateToVector3(scale),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
void Animation::Show(Actor& actor, float delaySeconds)
{
ExtendDuration( TimePeriod(delaySeconds, 0) );
TimePeriod(delaySeconds, 0.0f/*immediate*/) ) );
}
-void Animation::OpacityBy(Actor& actor, float opacity)
-{
- OpacityBy(actor, opacity, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityBy(Actor& actor, float opacity, AlphaFunction alpha)
-{
- OpacityBy(actor, opacity, alpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityBy(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::Property::COLOR,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateByOpacity(opacity),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::OpacityTo(Actor& actor, float opacity)
-{
- OpacityTo(actor, opacity, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityTo(Actor& actor, float opacity, AlphaFunction alpha)
-{
- OpacityTo(actor, opacity, alpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityTo(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::Property::COLOR,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateToOpacity(opacity),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ColorBy(Actor& actor, const Vector4& color)
-{
- ColorBy(actor, color, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha)
-{
- ColorBy(actor, color, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::Property::COLOR,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateByVector4(color),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ColorTo(Actor& actor, const Vector4& color)
-{
- ColorTo(actor, color, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha)
-{
- ColorTo(actor, color, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
- Dali::Actor::Property::COLOR,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateToVector4(color),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::Resize(Actor& actor, float width, float height)
-{
- Resize(actor, width, height, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, float width, float height, AlphaFunction alpha)
-{
- Resize(actor, width, height, alpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- Vector3 targetSize( width, height, std::min(width, height) );
-
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- // Notify the actor impl that its size is being animated
- actor.NotifySizeAnimation( *this, targetSize );
-
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::Property::SIZE,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateToVector3(targetSize),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::Resize(Actor& actor, const Vector3& size)
-{
- Resize(actor, size, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, const Vector3& size, AlphaFunction alpha)
-{
- Resize(actor, size, alpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, const Vector3& size, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
- // Notify the actor impl that its size is being animated
- actor.NotifySizeAnimation( *this, size );
-
- AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
- Dali::Actor::Property::SIZE,
- Property::INVALID_COMPONENT_INDEX,
- new AnimateToVector3(size),
- alpha,
- TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
bool Animation::DoAction( BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes )
{
bool done = false;
void Animate( Actor& actor, const Path& path, const Vector3& forward, AlphaFunction alpha, TimePeriod period);
/**
- * @copydoc Dali::Animation::MoveBy(Actor actor, float x, float y, float z)
- */
- void MoveBy(Actor& actor, float x, float y, float z);
-
- /**
- * @copydoc Dali::Animation::MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha)
- */
- void MoveBy(Actor& actor, const Vector3& translation, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void MoveBy(Actor& actor, const Vector3& translation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::MoveTo(Actor actor, float x, float y, float z)
- */
- void MoveTo(Actor& actor, float x, float y, float z);
-
- /**
- * @copydoc Dali::Animation::MoveTo(Actor actor, Vector3 position, AlphaFunction alpha)
- */
- void MoveTo(Actor& actor, const Vector3& translation, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void MoveTo(Actor& actor, const Vector3& translation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::RotateBy(Actor actor, Radian angle, Vector3 axis)
- */
- void RotateBy(Actor& actor, Radian angle, const Vector3& axis);
-
- /**
- * @copydoc Dali::Animation::RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha)()
- */
- void RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::RotateTo(Actor actor, Radian angle, Vector3 axis)
- */
- void RotateTo(Actor& actor, Radian angle, const Vector3& axis);
-
- /**
- * @copydoc Dali::Animation::RotateTo(Actor actor, Quaternion orientation)
- */
- void RotateTo(Actor& actor, const Quaternion& orientation);
-
- /**
- * @copydoc Dali::Animation::RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha)
- */
- void RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha)
- */
- void RotateTo(Actor& actor, const Quaternion& orientation, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void RotateTo(Actor& actor, const Quaternion& orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)()
- */
- void RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::ScaleBy(Actor actor, float x, float y, float z)()
- */
- void ScaleBy(Actor& actor, float x, float y, float z);
-
- /**
- * @copydoc Dali::Animation::ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha)
- */
- void ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::ScaleTo(Actor actor, float x, float y, float z)
- */
- void ScaleTo(Actor& actor, float x, float y, float z);
-
- /**
- * @copydoc Dali::Animation::ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha)
- */
- void ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
* @copydoc Dali::Animation::Show()
*/
void Show(Actor& actor, float delaySeconds);
*/
void Hide(Actor& actor, float delaySeconds);
- /**
- * @copydoc Dali::Animation::OpacityBy(Actor actor, float opacity)
- */
- void OpacityBy(Actor& actor, float opacity);
-
- /**
- * @copydoc Dali::Animation::OpacityBy(Actor actor, float opacity, AlphaFunction alpha)
- */
- void OpacityBy(Actor& actor, float opacity, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)()
- */
- void OpacityBy(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::OpacityTo(Actor actor, float opacity)
- */
- void OpacityTo(Actor& actor, float opacity);
-
- /**
- * @copydoc Dali::Animation::OpacityTo(Actor actor, float opacity, AlphaFunction alpha)
- */
- void OpacityTo(Actor& actor, float opacity, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void OpacityTo(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::ColorBy(Actor actor, Vector4 color)
- */
- void ColorBy(Actor& actor, const Vector4& color);
-
- /**
- * @copydoc Dali::Animation::ColorBy(Actor actor, Vector4 color, AlphaFunction alpha)
- */
- void ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::ColorTo(Actor actor, Vector4 color)
- */
- void ColorTo(Actor& actor, const Vector4& color);
-
- /**
- * @copydoc Dali::Animation::ColorTo(Actor actor, Vector4 color, AlphaFunction alpha)
- */
- void ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::Resize(Actor actor, float width, float height)
- */
- void Resize(Actor& actor, float width, float height);
-
- /**
- * @copydoc Dali::Animation::Resize(Actor actor, float width, float height, AlphaFunction alpha)
- */
- void Resize(Actor& actor, float width, float height, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::Resize(Actor actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void Resize(Actor& actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @copydoc Dali::Animation::Resize(Actor actor, Vector3 size)
- */
- void Resize(Actor& actor, const Vector3& size);
-
- /**
- * @copydoc Dali::Animation::Resize(Actor actor, Vector3 size, AlphaFunction alpha)
- */
- void Resize(Actor& actor, const Vector3& size, AlphaFunction alpha);
-
- /**
- * @copydoc Dali::Animation::Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds)
- */
- void Resize(Actor& actor, const Vector3& size, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
/*
* @copydoc Dali::Animation::SetCurrentProgress()
*/
if(!animatableProperty)
{
const TypeInfo* typeInfo( GetTypeInfo() );
- if (typeInfo && Property::INVALID_INDEX == RegisterSceneGraphProperty(typeInfo->GetPropertyName(index), index, propertyValue))
+ if (!typeInfo)
{
- DALI_LOG_ERROR("Cannot register property\n");
+ DALI_LOG_ERROR("Cannot find property index\n");
}
- else
+ else if ( Property::INVALID_INDEX == RegisterSceneGraphProperty( typeInfo->GetPropertyName( index ), index, propertyValue ) )
{
- DALI_LOG_ERROR("Cannot find property index\n");
+ DALI_LOG_ERROR("Cannot register property\n");
}
}
else
}
else
{
- mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( propertyValue.GetType(), property ) );
+ mAnimatableProperties.PushBack( new AnimatablePropertyMetadata( index, propertyValue.GetType(), property ) );
}
// queue a message to add the property
{
DALI_ASSERT_ALWAYS( false && "Property notification added to event side only property." );
}
+ else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+ {
+ // check whether the animatable property is registered already, if not then register one.
+ AnimatablePropertyMetadata* animatable = FindAnimatableProperty( index );
+ if( !animatable )
+ {
+ const TypeInfo* typeInfo( GetTypeInfo() );
+ if ( typeInfo )
+ {
+ if( Property::INVALID_INDEX != RegisterSceneGraphProperty( typeInfo->GetPropertyName( index ), index, Property::Value( typeInfo->GetPropertyType( index ) ) ) )
+ {
+ animatable = FindAnimatableProperty( index );
+ }
+ }
+ }
+ DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
+ }
else if ( mCustomProperties.Count() > 0 )
{
CustomPropertyMetadata* custom = FindCustomProperty( index );
AnimatablePropertyMetadata* Object::FindAnimatableProperty( Property::Index index ) const
{
- AnimatablePropertyMetadata* property( NULL );
- int arrayIndex = index - ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX;
- if( arrayIndex >= 0 )
+ for ( int arrayIndex = 0; arrayIndex < (int)mAnimatableProperties.Count(); arrayIndex++ )
{
- if( arrayIndex < (int)mAnimatableProperties.Count() )
+ AnimatablePropertyMetadata* property = static_cast<AnimatablePropertyMetadata*>( mAnimatableProperties[ arrayIndex ] );
+ if( property->index == index )
{
- property = static_cast<AnimatablePropertyMetadata*>(mAnimatableProperties[ arrayIndex ]);
+ return property;
}
}
- return property;
+ return NULL;
}
} // namespace Internal
*/
AnimatablePropertyMetadata* FindAnimatableProperty( Property::Index index ) const;
+ /**
+ * Helper to register a scene-graph property
+ * @param [in] name The name of the property.
+ * @param [in] index The index of the property
+ * @param [in] value The value of the property.
+ * @return The index of the registered property or Property::INVALID_INDEX if registration failed.
+ */
+ Property::Index RegisterSceneGraphProperty(const std::string& name, Property::Index index, const Property::Value& propertyValue) const;
+
private: // Default property extensions for derived classes
/**
*/
virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
- /**
- * Helper to register a scene-graph property
- * @param [in] name The name of the property.
- * @param [in] index The index of the property
- * @param [in] value The value of the property.
- * @return The index of the registered property or Property::INVALID_INDEX if registration failed.
- */
- Property::Index RegisterSceneGraphProperty(const std::string& name, Property::Index index, const Property::Value& propertyValue) const;
-
protected:
/**
* Get the event thread services object - used for sending messages to the scene graph
/**
* Constructor for metadata of animatable property
+ * @param [in] newIndex The index of the animatable property.
+ * @param [in] newType The type ID of the animatable property.
* @param [in] newProperty A pointer to the scene-graph owned property.
*/
- AnimatablePropertyMetadata( Property::Type newType,
+ AnimatablePropertyMetadata( Property::Index newIndex,
+ Property::Type newType,
const SceneGraph::PropertyBase* newProperty )
+ : index(newIndex)
{
type = newType;
mProperty = newProperty;
/**
* Constructor for metadata of animatable property
+ * @param [in] newIndex The index of the animatable property.
* @param [in] newValue The value of the scene-graph owned property.
*/
- AnimatablePropertyMetadata( Property::Value newValue )
+ AnimatablePropertyMetadata( Property::Index newIndex,
+ Property::Value newValue )
+ : index(newIndex)
{
type = newValue.GetType();
value = newValue;
return true ;
}
+ Property::Index index; ///< The index of the property
+
private:
// Not implemented
mRelayoutStack( new MemoryPoolRelayoutContainer( mRelayoutInfoAllocator ) ),
mRelayoutConnection( false ),
mRelayoutFlag( false ),
- mEnabled( false )
+ mEnabled( false ),
+ mPerformingRelayout( false )
{
// Make space for 32 controls to avoid having to copy construct a lot in the beginning
mRelayoutStack->Reserve( 32 );
// Only do something when requested
if( mRelayoutFlag )
{
+ mPerformingRelayout = true;
+
// Clear the flag as we're now doing the relayout
mRelayoutFlag = false;
PRINT_HIERARCHY;
}
+
+ mPerformingRelayout = false;
}
// should not disconnect the signal as that causes some control size negotiations to not work correctly
// this algorithm needs more optimization as well
mEnabled = enabled;
}
+bool RelayoutController::IsPerformingRelayout() const
+{
+ return mPerformingRelayout;
+}
+
void RelayoutController::FindAndZero( const RawActorList& list, const Dali::RefObject* object )
{
// Object has been destroyed so clear it from this list
*/
void SetEnabled( bool enabled );
+ /**
+ * @brief Return true if the relayout controller is currently performing a relayout
+ *
+ * @return Return true if the relayout controller is currently performing a relayout
+ */
+ bool IsPerformingRelayout() const;
+
public: // CALLBACKS
/**
bool mRelayoutConnection : 1; ///< Whether EventProcessingFinishedSignal signal is connected.
bool mRelayoutFlag : 1; ///< Relayout flag to avoid unnecessary calls
bool mEnabled : 1; ///< Initially disabled. Must be enabled at some point.
+ bool mPerformingRelayout : 1; ///< The relayout controller is currently performing a relayout
};
/**
* Updates transform values for the given node if the transform flag is dirty.
- * This includes applying a new size should the SizeMode require it.
- * Note that this will cause the size dirty flag to be set. This is why we pass
+ * Note that this will cause the size dirty flag to be set. This is why we pass
* the dirty flags in by reference.
* @param[in] node The node to update
* @param[in,out] nodeDirtyFlags A reference to the dirty flags, these may be modified by this function
// value types used by messages
template <> struct ParameterType< ColorMode > : public BasicType< ColorMode > {};
template <> struct ParameterType< PositionInheritanceMode > : public BasicType< PositionInheritanceMode > {};
-template <> struct ParameterType< SizeMode > : public BasicType< SizeMode > {};
namespace SceneGraph
{
};
/**
- * @brief Actor size relative to parent mode.
- */
-enum SizeMode
-{
- USE_OWN_SIZE, ///< The mode is bypassed. The size Vector3 will be used as normal.
- SIZE_RELATIVE_TO_PARENT, ///< The actors size will be ( ParentSize * SizeRelativeToParentFactor ).
- SIZE_FIXED_OFFSET_FROM_PARENT ///< The actors size will be ( ParentSize + SizeRelativeToParentFactor ).
-};
-
-/**
* @brief Dimensions for layout
*/
enum Dimension
{
FIXED, ///< Size is fixed as set by SetSize
USE_NATURAL_SIZE, ///< Size is to use the actor's natural size
- USE_ASSIGNED_SIZE, ///< The size will be assigned to the actor
FILL_TO_PARENT, ///< Size is to fill up to the actor's parent's bounds. Aspect ratio not maintained.
+ SIZE_RELATIVE_TO_PARENT, ///< The actors size will be ( ParentSize * SizeRelativeToParentFactor ).
+ SIZE_FIXED_OFFSET_FROM_PARENT, ///< The actors size will be ( ParentSize + SizeRelativeToParentFactor ).
FIT_TO_CHILDREN, ///< Size will adjust to wrap around all children
- DIMENSION_DEPENDENCY ///< One dimension is dependent on the other
+ DIMENSION_DEPENDENCY, ///< One dimension is dependent on the other
+ USE_ASSIGNED_SIZE ///< The size will be assigned to the actor
};
/**
#include <dali/internal/event/actors/layer-impl.h>
#include <dali/internal/event/actor-attachments/actor-attachment-impl.h>
#include <dali/internal/event/animation/constraint-impl.h>
+#include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
namespace Dali
{
void Actor::SetSize(float width, float height)
{
- GetImplementation(*this).SetSize(width, height);
+ if( IsRelayoutEnabled() )
+ {
+ GetImplementation(*this).SetPreferredSize( Vector2( width, height ) );
+ }
+ else
+ {
+ GetImplementation(*this).SetSize(width, height);
+ }
}
void Actor::SetSize(float width, float height, float depth)
{
- GetImplementation(*this).SetSize(width, height, depth);
+ if( IsRelayoutEnabled() )
+ {
+ GetImplementation(*this).SetPreferredSize( Vector2( width, height ) );
+ }
+ else
+ {
+ GetImplementation(*this).SetSize(width, height, depth);
+ }
}
void Actor::SetSize(const Vector2& size)
{
- GetImplementation(*this).SetSize(size);
+ if( IsRelayoutEnabled() )
+ {
+ GetImplementation(*this).SetPreferredSize( size );
+ }
+ else
+ {
+ GetImplementation(*this).SetSize( size );
+ }
}
void Actor::SetSize(const Vector3& size)
{
- GetImplementation(*this).SetSize(size);
+ if( IsRelayoutEnabled() )
+ {
+ GetImplementation(*this).SetPreferredSize( size.GetVectorXY() );
+ }
+ else
+ {
+ GetImplementation(*this).SetSize( size );
+ }
}
Vector3 Actor::GetTargetSize() const
return GetImplementation(*this).IsScaleInherited();
}
-void Actor::SetSizeMode(SizeMode mode)
-{
- GetImplementation(*this).SetSizeMode(mode);
-}
-
-SizeMode Actor::GetSizeMode() const
-{
- return GetImplementation(*this).GetSizeMode();
-}
-
void Actor::SetSizeModeFactor(const Vector3& factor)
{
GetImplementation(*this).SetSizeModeFactor(factor);
return GetImplementation(*this).GetSizeScalePolicy();
}
-void Actor::SetDimensionDependency( Dimension dimension, Dimension dependency )
-{
- GetImplementation(*this).SetDimensionDependency( dimension, dependency );
-}
-
-Dimension Actor::GetDimensionDependency( Dimension dimension )
-{
- return GetImplementation(*this).GetDimensionDependency( dimension );
-}
-
float Actor::GetHeightForWidth( float width )
{
return GetImplementation(*this).GetHeightForWidth( width );
paddingOut.top = heightPadding.y;
}
-void Actor::SetPreferredSize( const Vector2& size )
-{
- GetImplementation(*this).SetPreferredSize( size );
-}
-
-Vector2 Actor::GetPreferredSize() const
-{
- return GetImplementation(*this).GetPreferredSize();
-}
-
void Actor::SetMinimumSize( const Vector2& size )
{
Internal::Actor& impl = GetImplementation(*this);
COLOR_MODE, ///< name "color-mode", type std::string
POSITION_INHERITANCE, ///< name "position-inheritance", type std::string
DRAW_MODE, ///< name "draw-mode", type std::string
- SIZE_MODE, ///< name "size-mode", type std::string
SIZE_MODE_FACTOR, ///< name "size-mode-factor", type Vector3
RELAYOUT_ENABLED, ///< name "relayout-enabled", type Boolean
WIDTH_RESIZE_POLICY, ///< name "width-resize-policy", type String
PADDING, ///< name "padding", type Vector4
MINIMUM_SIZE, ///< name "minimum-size", type Vector2
MAXIMUM_SIZE, ///< name "maximum-size", type Vector2
- PREFERRED_SIZE ///< name "preferred-size", type Vector2
};
};
SizeScalePolicy GetSizeScalePolicy() const;
/**
- * @brief Defines how a child actor's size is affected by its parent's size.
- *
- * The default is to ignore the parent's size and use the size property of this actor.
- *
- * If USE_OWN_SIZE is used, this option is bypassed and the actor's size
- * property is used.
- *
- * If SIZE_RELATIVE_TO_PARENT is used, this actor's size will be based on
- * its parent's size by multiplying the parent size by
- * SizeModeFactor.
- *
- * If SIZE_FIXED_OFFSET_FROM_PARENT is used, this actor's size will be based on
- * its parent's size plus SizeModeFactor.
- *
- * @pre The Actor has been initialized.
- * @param[in] mode The size relative to parent mode to use.
- */
- void SetSizeMode( const SizeMode mode );
-
- /**
- * @brief Returns the actor's mode for modifying its size relative to its parent.
- *
- * @pre The Actor has been initialized.
- * @return The mode used.
- */
- SizeMode GetSizeMode() const;
-
- /**
* @brief Sets the relative to parent size factor of the actor.
*
- * This factor is only used when SizeMode is set to either:
- * SIZE_RELATIVE or SIZE_FIXED_OFFSET.
+ * This factor is only used when ResizePolicy is set to either:
+ * SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT.
* This actor's size is set to the actor's size multipled by or added to this factor,
- * depending on SideMode (See SetSizeMode).
+ * depending on ResizePolicy (See SetResizePolicy).
*
* @pre The Actor has been initialized.
* @param [in] factor A Vector3 representing the relative factor to be applied to each axis.
Vector3 GetSizeModeFactor() const;
/**
- * @brief This method specifies a dependency between dimensions. Will set resize policy on the actor for
- * the given dimension to be DIMENSION_DEPENDENCY.
- *
- * @param[in] dimension The dimension to set the dependency on
- * @param[in] dependency The dependency to set on the dimension
- */
- void SetDimensionDependency( Dimension dimension, Dimension dependency );
-
- /**
- * @brief Return the dependecy for a dimension
- *
- * @param[in] dimension The dimension to return the dependency for
- * @return Return the dependency
- */
- Dimension GetDimensionDependency( Dimension dimension );
-
- /**
* @brief Calculate the height of the actor given a width
*
* @param width Width to use
void GetPadding( Padding& paddingOut ) const;
/**
- * @brief Set the preferred size for size negotiation
- *
- * @param[in] size The preferred size to set
- */
- void SetPreferredSize( const Vector2& size );
-
- /**
- * @brief Return the preferred size used for size negotiation
- *
- * @return Return the preferred size
- */
- Vector2 GetPreferredSize() const;
-
- /**
* @brief Set the minimum size an actor can be assigned in size negotiation
*
* @param[in] size The minimum size
virtual void OnSizeSet(const Vector3& targetSize) = 0;
/**
- * @brief Called when the owning actor's size is animated e.g. using Animation::Resize().
+ * @brief Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ).
*
* @param[in] animation The object which is animating the owning actor.
* @param[in] targetSize The target size. Note that this target size may not match the size returned via Actor::GetSize().
GetImplementation(*this).Animate(GetImplementation(actor), GetImplementation( path ), forward, alpha, period );
}
-void Animation::MoveBy(Actor actor, float x, float y, float z)
-{
- GetImplementation(*this).MoveBy(GetImplementation(actor), x, y, z);
-}
-
-void Animation::MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha)
-{
- GetImplementation(*this).MoveBy(GetImplementation(actor), displacement, alpha);
-}
-
-void Animation::MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).MoveBy(GetImplementation(actor), displacement, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::MoveTo(Actor actor, float x, float y, float z)
-{
- GetImplementation(*this).MoveTo(GetImplementation(actor), x, y, z);
-}
-
-void Animation::MoveTo(Actor actor, Vector3 position, AlphaFunction alpha)
-{
- GetImplementation(*this).MoveTo(GetImplementation(actor), position, alpha);
-}
-
-void Animation::MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).MoveTo(GetImplementation(actor), position, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateBy(Actor actor, Degree angle, Vector3 axis)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), Radian(angle), axis);
-}
-
-void Animation::RotateBy(Actor actor, Radian angle, Vector3 axis)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), angle, axis);
-}
-
-void Animation::RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), Radian(angle), axis, alpha);
-}
-
-void Animation::RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), angle, axis, alpha);
-}
-
-void Animation::RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), Radian(angle), axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateBy(GetImplementation(actor), angle, axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor actor, Degree angle, Vector3 axis)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), Radian(angle), axis);
-}
-
-void Animation::RotateTo(Actor actor, Radian angle, Vector3 axis)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), angle, axis);
-}
-
-void Animation::RotateTo(Actor actor, Quaternion rotation)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), rotation);
-}
-
-void Animation::RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), Radian(angle), axis, alpha);
-}
-
-void Animation::RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), angle, axis, alpha);
-}
-
-void Animation::RotateTo(Actor actor, Quaternion rotation, AlphaFunction alpha)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), rotation, alpha);
-}
-
-void Animation::RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), Radian(angle), axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), angle, axis, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor actor, Quaternion rotation, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).RotateTo(GetImplementation(actor), rotation, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::ScaleBy(Actor actor, float x, float y, float z)
-{
- GetImplementation(*this).ScaleBy(GetImplementation(actor), x, y, z);
-}
-
-void Animation::ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha)
-{
- GetImplementation(*this).ScaleBy(GetImplementation(actor), scale, alpha);
-}
-
-void Animation::ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).ScaleBy(GetImplementation(actor), scale, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::ScaleTo(Actor actor, float x, float y, float z)
-{
- GetImplementation(*this).ScaleTo(GetImplementation(actor), x, y, z);
-}
-
-void Animation::ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha)
-{
- GetImplementation(*this).ScaleTo(GetImplementation(actor), scale, alpha);
-}
-
-void Animation::ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).ScaleTo(GetImplementation(actor), scale, alpha, delaySeconds, durationSeconds);
-}
-
void Animation::Show(Actor actor, float delaySeconds)
{
GetImplementation(*this).Show(GetImplementation(actor), delaySeconds);
GetImplementation(*this).Hide(GetImplementation(actor), delaySeconds);
}
-void Animation::OpacityBy(Actor actor, float opacity)
-{
- GetImplementation(*this).OpacityBy(GetImplementation(actor), opacity);
-}
-
-void Animation::OpacityBy(Actor actor, float opacity, AlphaFunction alpha)
-{
- GetImplementation(*this).OpacityBy(GetImplementation(actor), opacity, alpha);
-}
-
-void Animation::OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).OpacityBy(GetImplementation(actor), opacity, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::OpacityTo(Actor actor, float opacity)
-{
- GetImplementation(*this).OpacityTo(GetImplementation(actor), opacity);
-}
-
-void Animation::OpacityTo(Actor actor, float opacity, AlphaFunction alpha)
-{
- GetImplementation(*this).OpacityTo(GetImplementation(actor), opacity, alpha);
-}
-
-void Animation::OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).OpacityTo(GetImplementation(actor), opacity, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::ColorBy(Actor actor, Vector4 color)
-{
- GetImplementation(*this).ColorBy(GetImplementation(actor), color);
-}
-
-void Animation::ColorBy(Actor actor, Vector4 color, AlphaFunction alpha)
-{
- GetImplementation(*this).ColorBy(GetImplementation(actor), color, alpha);
-}
-
-void Animation::ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).ColorBy(GetImplementation(actor), color, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::ColorTo(Actor actor, Vector4 color)
-{
- GetImplementation(*this).ColorTo(GetImplementation(actor), color);
-}
-
-void Animation::ColorTo(Actor actor, Vector4 color, AlphaFunction alpha)
-{
- GetImplementation(*this).ColorTo(GetImplementation(actor), color, alpha);
-}
-
-void Animation::ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).ColorTo(GetImplementation(actor), color, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::Resize(Actor actor, float width, float height)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), width, height);
-}
-
-void Animation::Resize(Actor actor, float width, float height, AlphaFunction alpha)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), width, height, alpha);
-}
-
-void Animation::Resize(Actor actor,float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), width, height, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::Resize(Actor actor, Vector3 size)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), size);
-}
-
-void Animation::Resize(Actor actor, Vector3 size, AlphaFunction alpha)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), size, alpha);
-}
-
-void Animation::Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
- GetImplementation(*this).Resize(GetImplementation(actor), size, alpha, delaySeconds, durationSeconds);
-}
-
void Animation::SetCurrentProgress( float progress )
{
return GetImplementation(*this).SetCurrentProgress( progress );
{
class Actor;
-struct Degree;
-class Quaternion;
-struct Radian;
-class ShaderEffect;
struct Property;
struct Vector2;
struct Vector3;
-struct Vector4;
namespace Internal DALI_INTERNAL
{
* // ...To play the animation
*
* mAnimation = Animation::New(3.0f); // duration 3 seconds
- * mAnimation.MoveTo(mActor, 10.0f, 50.0f, 0.0f);
+ * mAnimation.AnimateTo(Property(mActor, Actor::Property::POSITION), Vector3(10.0f, 50.0f, 0.0f));
* mAnimation.Play();
*
* @endcode
* void ExampleAnimation( Actor actor )
* {
* Animation animation = Animation::New(2.0f); // duration 2 seconds
- * animation.MoveTo(actor, 10.0f, 50.0f, 0.0f);
+ * animation.AnimateTo(Property(actor, Actor::Property::POSITION), 10.0f, 50.0f, 0.0f);
* animation.FinishedSignal().Connect( ExampleCallback );
* animation.Play();
* } // At this point the animation handle has gone out of scope
void Animate( Actor actor, Path path, const Vector3& forward, AlphaFunction alpha, TimePeriod period);
/**
- * @brief Move an actor relative to its position.
- *
- * The default alpha function will be used.
- * The move will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] x axis displacement.
- * @param [in] y axis displacement.
- * @param [in] z axis displacement.
- */
- void MoveBy(Actor actor, float x, float y, float z);
-
- /**
- * @brief Move an actor relative to its position.
- *
- * This overload allows the alpha function to be customized.
- * The move will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] displacement relative to current position.
- * @param [in] alpha The alpha function to apply.
- */
- void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha);
-
- /**
- * @brief Move an actor relative to its position.
- *
- * This overload allows the translation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] displacement relative to current position.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the translation.
- */
- void MoveBy(Actor actor, Vector3 displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Move an actor to a target position.
- *
- * The default alpha function will be used.
- * The move will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] x axis position.
- * @param [in] y axis position.
- * @param [in] z axis position.
- */
- void MoveTo(Actor actor, float x, float y, float z);
-
- /**
- * @brief Move an actor to a target position.
- *
- * This overload allows the alpha function to be customized.
- * The move will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] position to move to
- * @param [in] alpha The alpha function to apply.
- */
- void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha);
-
- /**
- * @brief Move an actor to a target position.
- *
- * This overload allows the translation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] position to move to
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the translation.
- */
- void MoveTo(Actor actor, Vector3 position, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Rotate an actor around an arbitrary axis.
- *
- * The default alpha function will be used.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The angle in degrees.
- * @param [in] axis The axis to rotate around
- */
- void RotateBy(Actor actor, Degree angle, Vector3 axis);
-
- /**
- * @brief Rotate an actor around an arbitrary axis.
- *
- * The default alpha function will be used.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The angle in radians.
- * @param [in] axis The axis to rotate around
- */
- void RotateBy(Actor actor, Radian angle, Vector3 axis);
-
- /**
- * @brief Rotate an actor around an arbitrary axis.
- *
- * This overload allows the alpha function to be customized.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The angle in radians.
- * @param [in] axis The axis to rotate around.
- * @param [in] alpha The alpha function to apply.
- */
- void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
-
- /**
- * @brief Rotate an actor around an arbitrary axis.
- *
- * This overload allows the alpha function to be customized.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The angle in radians.
- * @param [in] axis The axis to rotate around.
- * @param [in] alpha The alpha function to apply.
- */
- void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
-
- /**
- * @brief Rotate an actor around an arbitrary axis.
- *
- * This overload allows the rotation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] angle The angle in degrees.
- * @param [in] axis The axis to rotate around
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the rotation.
- */
- void RotateBy(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Rotate an actor around an arbitrary axis.
- *
- * This overload allows the rotation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] angle The angle in radians.
- * @param [in] axis The axis to rotate around
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the rotation.
- */
- void RotateBy(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * The default alpha function will be used.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The target rotation angle in degrees.
- * @param [in] axis The target axis of rotation.
- */
- void RotateTo(Actor actor, Degree angle, Vector3 axis);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * The default alpha function will be used.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The target rotation angle in radians.
- * @param [in] axis The target axis of rotation.
- */
- void RotateTo(Actor actor, Radian angle, Vector3 axis);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * The default alpha function will be used.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] orientation The target orientation.
- */
- void RotateTo(Actor actor, Quaternion orientation);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * This overload allows the alpha function to be customized.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The target rotation angle in degrees.
- * @param [in] axis The target axis of rotation.
- * @param [in] alpha The alpha function to apply.
- */
- void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * This overload allows the alpha function to be customized.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] angle The target rotation angle in radians.
- * @param [in] axis The target axis of rotation.
- * @param [in] alpha The alpha function to apply.
- */
- void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * This overload allows the alpha function to be customized.
- * The rotation will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] orientation The target orientation.
- * @param [in] alpha The alpha function to apply.
- */
- void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * This overload allows the rotation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] angle The target rotation angle in degrees.
- * @param [in] axis The target axis of rotation.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the rotation.
- */
- void RotateTo(Actor actor, Degree angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * This overload allows the rotation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] angle The target rotation angle in radians.
- * @param [in] axis The target axis of rotation.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the rotation.
- */
- void RotateTo(Actor actor, Radian angle, Vector3 axis, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Rotate an actor to a target orientation.
- *
- * This overload allows the rotation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] orientation The target orientation.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the rotation.
- */
- void RotateTo(Actor actor, Quaternion orientation, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Scale an actor.
- *
- * The default alpha function will be used.
- * The scaling will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] x Scale factor in the X-direction.
- * @param [in] y Scale factor in the Y-direction.
- * @param [in] z Scale factor in the Z-direction.
- */
- void ScaleBy(Actor actor, float x, float y, float z);
-
- /**
- * @brief Scale an actor.
- *
- * This overload allows the alpha function to be customized.
- * The scaling will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] scale The scale factor.
- * @param [in] alpha The alpha function to apply.
- */
- void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha);
-
- /**
- * @brief Scale an actor.
- *
- * This overload allows the scaling start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] scale The scale factor.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the scaling.
- */
- void ScaleBy(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Scale an actor to a target scale factor.
- *
- * The default alpha function will be used.
- * The scaling will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] x Target scale-factor in the X-direction.
- * @param [in] y Target scale-factor in the Y-direction.
- * @param [in] z Target scale-factor in the Z-direction.
- */
- void ScaleTo(Actor actor, float x, float y, float z);
-
- /**
- * @brief Scale an actor to a target scale factor.
- *
- * This overload allows the alpha function to be customized.
- * The scaling will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] scale The target scale factor.
- * @param [in] alpha The alpha function to apply.
- */
- void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha);
-
- /**
- * @brief Scale an actor to a target scale factor.
- *
- * This overload allows the scaling start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] scale The target scale factor.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the scaling.
- */
- void ScaleTo(Actor actor, Vector3 scale, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
* @brief Show an actor during the animation.
*
* @param [in] actor The actor to animate.
*/
void Hide(Actor actor, float delaySeconds);
- /**
- * @brief Animate the opacity of an actor.
- *
- * The default alpha function will be used.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] opacity The relative change in opacity.
- */
- void OpacityBy(Actor actor, float opacity);
-
- /**
- * @brief Animate the opacity of an actor.
- *
- * This overload allows the alpha function to be customized.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] opacity The relative change in opacity.
- * @param [in] alpha The alpha function to apply.
- */
- void OpacityBy(Actor actor, float opacity, AlphaFunction alpha);
-
- /**
- * @brief Animate the opacity of an actor.
- *
- * This overload allows the animation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] opacity The relative change in opacity.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the opacity animation.
- */
- void OpacityBy(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Animate an actor to a target opacity.
- *
- * The default alpha function will be used.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] opacity The target opacity.
- */
- void OpacityTo(Actor actor, float opacity);
-
- /**
- * @brief Animate an actor to a target opacity.
- *
- * This overload allows the alpha function to be customized.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] opacity The target opacity.
- * @param [in] alpha The alpha function to apply.
- */
- void OpacityTo(Actor actor, float opacity, AlphaFunction alpha);
-
- /**
- * @brief Animate an actor to a target opacity.
- *
- * This overload allows the animation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] opacity The target opacity.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the opacity animation.
- */
- void OpacityTo(Actor actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Animate the color of an actor.
- *
- * The default alpha function will be used.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] color The relative change in color.
- */
- void ColorBy(Actor actor, Vector4 color);
-
- /**
- * @brief Animate the color of an actor.
- *
- * This overload allows the alpha function to be customized.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] color The relative change in color.
- * @param [in] alpha The alpha function to apply.
- */
- void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha);
-
- /**
- * @brief Animate the color of an actor.
- *
- * This overload allows the animation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] color The relative change in color.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the color animation.
- */
- void ColorBy(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Animate an actor to a target color.
- *
- * The default alpha function will be used.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] color The target color.
- */
- void ColorTo(Actor actor, Vector4 color);
-
- /**
- * @brief Animate an actor to a target color.
- *
- * This overload allows the alpha function to be customized.
- * The effect will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] color The target color.
- * @param [in] alpha The alpha function to apply.
- */
- void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha);
-
- /**
- * @brief Animate an actor to a target color.
- *
- * This overload allows the animation start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] color The target color.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the color animation.
- */
- void ColorTo(Actor actor, Vector4 color, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Resize an actor.
- *
- * The default alpha function will be used.
- * The resizing will start & end when the animation begins & ends.
- * The depth defaults to the minimum of width & height.
- * @param [in] actor The actor to animate.
- * @param [in] width The target width.
- * @param [in] height The target height.
- */
- void Resize(Actor actor, float width, float height);
-
- /**
- * @brief Resize an actor.
- *
- * This overload allows the alpha function to be customized.
- * The resizing will start & end when the animation begins & ends.
- * The depth defaults to the minimum of width & height.
- * @param [in] actor The actor to animate.
- * @param [in] width The target width.
- * @param [in] height The target height.
- * @param [in] alpha The alpha function to apply.
- */
- void Resize(Actor actor, float width, float height, AlphaFunction alpha);
-
- /**
- * @brief Resize an actor.
- *
- * This overload allows the resizing start & end time to be customized.
- * The depth defaults to the minimum of width & height.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] width The target width.
- * @param [in] height The target height.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the resizing.
- */
- void Resize(Actor actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
- /**
- * @brief Resize an actor.
- *
- * The default alpha function will be used.
- * The resizing will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] size The target size.
- */
- void Resize(Actor actor, Vector3 size);
-
- /**
- * @brief Resize an actor.
- *
- * This overload allows the alpha function to be customized.
- * The resizing will start & end when the animation begins & ends.
- * @param [in] actor The actor to animate.
- * @param [in] size The target size.
- * @param [in] alpha The alpha function to apply.
- */
- void Resize(Actor actor, Vector3 size, AlphaFunction alpha);
-
- /**
- * @brief Resize an actor.
- *
- * This overload allows the resizing start & end time to be customized.
- * @pre delaySeconds must be zero or greater.
- * @pre durationSeconds must be zero or greater; zero is useful when animating boolean values.
- * @param [in] actor The actor to animate.
- * @param [in] size The target size.
- * @param [in] alpha The alpha function to apply.
- * @param [in] delaySeconds The initial delay from the start of the animation.
- * @param [in] durationSeconds The duration of the resizing.
- */
- void Resize(Actor actor, Vector3 size, AlphaFunction alpha, float delaySeconds, float durationSeconds);
-
public: // Not intended for use by Application developers
/**
const unsigned int CORE_MAJOR_VERSION = 1;
const unsigned int CORE_MINOR_VERSION = 0;
-const unsigned int CORE_MICRO_VERSION = 35;
+const unsigned int CORE_MICRO_VERSION = 36;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
DALI_COMPILE_TIME_ASSERT( ( Toolkit::objectType::Property::enumIndex - Toolkit::objectType::PROPERTY_START_INDEX ) == count );
#define DALI_ANIMATABLE_PROPERTY_REGISTRATION_INTERNAL( count, typeRegistrationObject, objectType, text, valueType, enumIndex) \
- AnimatablePropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, Toolkit::objectType::AnimatableProperty::enumIndex, Property::valueType ); \
- DALI_COMPILE_TIME_ASSERT( ( Toolkit::objectType::AnimatableProperty::enumIndex - Toolkit::objectType::ANIMATABLE_PROPERTY_START_INDEX ) == count );
+ AnimatablePropertyRegistration DALI_TOKEN_PASTE( property, count ) ( typeRegistrationObject, text, Toolkit::objectType::Property::enumIndex, Property::valueType );
#define DALI_SIGNAL_REGISTRATION_INTERNAL( count, typeRegistrationObject, objectType, text, textVariable ) \
const char* const textVariable = text; \
Name: dali
Summary: The OpenGLES Canvas Core Library
-Version: 1.0.35
+Version: 1.0.36
Release: 1
Group: System/Libraries
License: Apache-2.0