application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().width, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().height, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentSize().depth, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().x, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().y, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
application.SendNotification();
finishCheck.CheckSignalNotReceived();
DALI_TEST_EQUALS( actor.GetCurrentPosition().z, fiftyPercentProgress, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), startValue, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), fiftyPercentProgress, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
{
mTargetSize.height = targetSize;
}
+ else if ( Dali::Actor::Property::SIZE_DEPTH == property )
+ {
+ mTargetSize.depth = targetSize;
+ }
// Notify deriving classes
OnSizeAnimation( animation, mTargetSize );
}
+void Actor::NotifyPositionAnimation( Animation& animation, const Vector3& targetPosition )
+{
+ mTargetPosition = targetPosition;
+}
+
+void Actor::NotifyPositionAnimation( Animation& animation, float targetPosition, Property::Index property )
+{
+ if ( Dali::Actor::Property::POSITION_X == property )
+ {
+ mTargetPosition.x = targetPosition;
+ }
+ else if ( Dali::Actor::Property::POSITION_Y == property )
+ {
+ mTargetPosition.y = targetPosition;
+ }
+ else if ( Dali::Actor::Property::POSITION_Z == property )
+ {
+ mTargetPosition.z = targetPosition;
+ }
+}
+
void Actor::SetWidth( float width )
{
if( NULL != mNode )
case Dali::Actor::Property::SIZE:
{
- value = GetCurrentSize();
+ value = GetTargetSize();
break;
}
case Dali::Actor::Property::SIZE_WIDTH:
{
- value = GetCurrentSize().width;
+ value = GetTargetSize().width;
break;
}
case Dali::Actor::Property::SIZE_HEIGHT:
{
- value = GetCurrentSize().height;
+ value = GetTargetSize().height;
break;
}
case Dali::Actor::Property::SIZE_DEPTH:
{
- value = GetCurrentSize().depth;
+ value = GetTargetSize().depth;
break;
}
case Dali::Actor::Property::POSITION:
{
- value = GetCurrentPosition();
+ value = GetTargetPosition();
break;
}
case Dali::Actor::Property::POSITION_X:
{
- value = GetCurrentPosition().x;
+ value = GetTargetPosition().x;
break;
}
case Dali::Actor::Property::POSITION_Y:
{
- value = GetCurrentPosition().y;
+ value = GetTargetPosition().y;
break;
}
case Dali::Actor::Property::POSITION_Z:
{
- value = GetCurrentPosition().z;
+ value = GetTargetPosition().z;
break;
}
void NotifySizeAnimation( Animation& animation, const Vector3& targetSize );
/**
- * This should only be called by Animation, when the actors SIZE_WIDTH or SIZE_HEIGHT property is animated.
+ * This should only be called by Animation, when the actors SIZE_WIDTH or SIZE_HEIGHT or SIZE_DEPTH property is animated.
*
* @param[in] animation The animation that resized the actor
* @param[in] targetSize The new target size of the actor
+ * @param[in] property The index of the property being animated
*/
void NotifySizeAnimation( Animation& animation, float targetSize, Property::Index property );
{
}
+ /**
+ * This should only be called by Animation, when the actors POSITION property is animated.
+ *
+ * @param[in] animation The animation that repositioned the actor
+ * @param[in] targetPosition The new target position of the actor
+ */
+ void NotifyPositionAnimation( Animation& animation, const Vector3& targetPosition );
+
+ /**
+ * This should only be called by Animation, when the actors POSITION_X or POSITION_Y or POSITION_Z property is animated.
+ *
+ * @param[in] animation The animation that repositioned the actor
+ * @param[in] targetPosition The new target position of the actor
+ * @param[in] property The index of the property being animated
+ */
+ void NotifyPositionAnimation( Animation& animation, float targetPosition, Property::Index property );
+
protected:
enum DerivedType
case Property::FLOAT:
{
- if ( ( Dali::Actor::Property::SIZE_WIDTH == targetPropertyIndex )||
- ( Dali::Actor::Property::SIZE_HEIGHT == targetPropertyIndex ) )
+ if ( ( Dali::Actor::Property::SIZE_WIDTH == targetPropertyIndex ) ||
+ ( Dali::Actor::Property::SIZE_HEIGHT == targetPropertyIndex ) ||
+ ( Dali::Actor::Property::SIZE_DEPTH == targetPropertyIndex ) )
{
// Test whether this is actually an Actor
Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
maybeActor->NotifySizeAnimation( *this, destinationValue.Get<float>(), targetPropertyIndex );
}
}
+ else if ( ( Dali::Actor::Property::POSITION_X == targetPropertyIndex ) ||
+ ( Dali::Actor::Property::POSITION_Y == targetPropertyIndex ) ||
+ ( Dali::Actor::Property::POSITION_Z == targetPropertyIndex ) )
+ {
+ // Test whether this is actually an Actor
+ Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
+ if ( maybeActor )
+ {
+ // Notify the actor that its position is being animated
+ maybeActor->NotifyPositionAnimation( *this, destinationValue.Get<float>(), targetPropertyIndex );
+ }
+ }
+
AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
targetPropertyIndex,
componentIndex,
maybeActor->NotifySizeAnimation( *this, destinationValue.Get<Vector3>() );
}
}
+ else if ( Dali::Actor::Property::POSITION == targetPropertyIndex )
+ {
+ // Test whether this is actually an Actor
+ Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
+ if ( maybeActor )
+ {
+ // Notify the actor that its position is being animated
+ maybeActor->NotifyPositionAnimation( *this, destinationValue.Get<Vector3>() );
+ }
+ }
AddAnimatorConnector( AnimatorConnector<Vector3>::New( targetObject,
targetPropertyIndex,