}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str());
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_CHECK(0);
}
END_TEST;
}
catch (Dali::DaliException& e)
{
- tet_printf("Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
+ DALI_TEST_PRINT_ASSERT( e );
DALI_TEST_CHECK(0);
}
END_TEST;
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a local input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- LocalSource( Actor::COLOR ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ LocalSource( Actor::Property::COLOR ),
MoveAwayWithFadeConstraint(distanceWhenFullyTransparent) );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), ( startValue - Vector3(0.0f, 0.0f, progress*distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), ( startValue - Vector3(0.0f, 0.0f, progress*distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
}
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), ( startValue - Vector3(0.0f, 0.0f, distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), ( startValue - Vector3(0.0f, 0.0f, distanceWhenFullyTransparent) ), POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ ParentSource( Actor::Property::SIZE ),
TestBottomRightAlignConstraint() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), parentStartSize, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), parent.GetCurrentSize(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), parentStartSize, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), parent.GetCurrentSize(), TEST_LOCATION );
// Gradually shrink the parent; the actor should move inwards
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), size, POSITION_EPSILON, TEST_LOCATION );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), parent.GetCurrentSize(), POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), size, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), parent.GetCurrentSize(), POSITION_EPSILON, TEST_LOCATION );
}
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), Vector3::ZERO, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3::ZERO, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( sibling1, Actor::Property::POSITION ),
MeanPositionConstraint1() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), sibling1.GetCurrentPosition(), TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( sibling1, Actor::Property::POSITION ),
+ Source( sibling2, Actor::Property::POSITION ),
MeanPositionConstraint2() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( sibling1, Actor::Property::POSITION ),
+ Source( sibling2, Actor::Property::POSITION ),
+ Source( sibling3, Actor::Property::POSITION ),
MeanPositionConstraint3() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- ParentSource( Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( sibling1, Actor::Property::POSITION ),
+ Source( sibling2, Actor::Property::POSITION ),
+ ParentSource( Actor::Property::POSITION ),
+ Source( sibling3, Actor::Property::POSITION ),
MeanPositionConstraint4() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- ParentSource( Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
- Source( sibling4, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( sibling1, Actor::Property::POSITION ),
+ Source( sibling2, Actor::Property::POSITION ),
+ ParentSource( Actor::Property::POSITION ),
+ Source( sibling3, Actor::Property::POSITION ),
+ Source( sibling4, Actor::Property::POSITION ),
MeanPositionConstraint5() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
*/
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Apply constraint with a parent input property
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( child, Actor::POSITION ),
- Source( sibling1, Actor::POSITION ),
- Source( sibling2, Actor::POSITION ),
- ParentSource( Actor::POSITION ),
- Source( sibling3, Actor::POSITION ),
- Source( sibling4, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( child, Actor::Property::POSITION ),
+ Source( sibling1, Actor::Property::POSITION ),
+ Source( sibling2, Actor::Property::POSITION ),
+ ParentSource( Actor::Property::POSITION ),
+ Source( sibling3, Actor::Property::POSITION ),
+ Source( sibling4, Actor::Property::POSITION ),
MeanPositionConstraint6() );
actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
application.Render(0);
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), meanValue, POSITION_EPSILON, TEST_LOCATION );
END_TEST;
}
// Build constraint
Vector4 targetColor(Color::BLACK);
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestColorConstraint(targetColor) );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::COLOR, TestColorConstraint(targetColor) );
DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(0.0f), TEST_LOCATION);
float applySeconds(7.0f);
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::COLOR, TestConstraint() );
DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(0.0f), TEST_LOCATION);
float applySeconds(7.0f);
END_TEST;
}
-int UtcDaliConstraintSetRemoveTime(void)
-{
- TestApplication application;
-
- Vector3 sourcePosition(0.0f, 0.0f, 0.0f);
- Vector3 targetPosition(100.0f, 100.0f, 100.0f);
-
- // Build constraint
-
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, TestPositionConstraint(targetPosition) );
- DALI_TEST_EQUALS(constraint.GetRemoveTime(), TimePeriod(0.0f), TEST_LOCATION);
-
- float removeSeconds(8.0f);
- constraint.SetRemoveTime(removeSeconds);
- DALI_TEST_EQUALS(constraint.GetRemoveTime(), TimePeriod(removeSeconds), TEST_LOCATION);
-
- // Apply to an actor
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
-
- actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(100u/*0.1 seconds*/);
-
- // Constraint should be fully applied
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
-
- // Check that nothing has changed after a couple of buffer swaps
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
-
- // Remove from the actor, and set to alternative position
-
- actor.RemoveConstraints();
-
- Vector3 thirdPosition(200.0f, 200.0f, 200.0f);
- actor.SetPosition(thirdPosition); // Go back to 3rd position
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 20% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 twentyPercentBack( targetPosition + (thirdPosition - targetPosition)*0.2f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), twentyPercentBack, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 40% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 fourtyPercentBack( targetPosition + (thirdPosition - targetPosition)*0.4f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), fourtyPercentBack, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 60% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 sixtyPercentBack( targetPosition + (thirdPosition - targetPosition)*0.6f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sixtyPercentBack, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 80% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 eightyPercentBack( targetPosition + (thirdPosition - targetPosition)*0.8f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), eightyPercentBack, TEST_LOCATION );
-
- // Constraint should be fully removed
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 100% removal progress */);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), thirdPosition, TEST_LOCATION );
-
- // Constraint should still be fully applied
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* Still 100% removal progress */);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), thirdPosition, TEST_LOCATION );
-
- // Check that nothing has changed after a couple of buffer swaps
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), thirdPosition, TEST_LOCATION );
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), thirdPosition, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliConstraintGetRemoveTime(void)
-{
- TestApplication application;
-
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
- DALI_TEST_EQUALS(constraint.GetRemoveTime(), TimePeriod(0.0f), TEST_LOCATION);
- END_TEST;
-}
-
int UtcDaliConstraintSetAlphaFunction(void)
{
TestApplication application;
Vector3 startValue( Vector3::ZERO );
Vector3 targetValue(100.0f, 100.0f, 100.0f);
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
TestConstraintVector3( targetValue ) );
// Test the alpha-function itself
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
constraint.SetApplyTime( 10.0f );
actor.ApplyConstraint( constraint );
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.1f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.1f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.2f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.2f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.3f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.3f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.4f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.4f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.5f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.6f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.6f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.7f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.7f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.8f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.8f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue) * 0.9f, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue) * 0.9f, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue), TEST_LOCATION );
// Check that the constrained value is stable
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue), TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue), TEST_LOCATION );
// Remove the constraint
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), startValue, TEST_LOCATION );
// Change to non-linear alpha and retest
application.SendNotification();
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).x > startValue.x );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).y > startValue.y );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).z > startValue.z );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::POSITION ).x > startValue.x );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::POSITION ).y > startValue.y );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::POSITION ).z > startValue.z );
Vector3 lessThanTenPercentProgress( (targetValue - startValue) * 0.09f );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).x < lessThanTenPercentProgress.x );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).y < lessThanTenPercentProgress.y );
- DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::POSITION ).z < lessThanTenPercentProgress.z );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::POSITION ).x < lessThanTenPercentProgress.x );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::POSITION ).y < lessThanTenPercentProgress.y );
+ DALI_TEST_CHECK( actor.GetProperty<Vector3>( Actor::Property::POSITION ).z < lessThanTenPercentProgress.z );
application.Render(static_cast<unsigned int>(9000.0f/*9 seconds*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue), TEST_LOCATION );
// Check that the constrained value is stable
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue), TEST_LOCATION );
application.Render(static_cast<unsigned int>(1000.0f/*1 second*/));
- DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::POSITION ), (targetValue - startValue), TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>( Actor::Property::POSITION ), (targetValue - startValue), TEST_LOCATION );
END_TEST;
}
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::COLOR, TestConstraint() );
AlphaFunction func = constraint.GetAlphaFunction();
DALI_TEST_EQUALS(func(0.5f), 0.5f, TEST_LOCATION); // Default is Linear
// Build constraint, with "Discard" remove action
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, TestPositionConstraint(targetPosition) );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION, TestPositionConstraint(targetPosition) );
DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION);
constraint.SetRemoveAction(Constraint::Discard);
DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Discard, TEST_LOCATION);
- float removeSeconds(8.0f);
- constraint.SetRemoveTime(removeSeconds);
- DALI_TEST_EQUALS(constraint.GetRemoveTime(), TimePeriod(removeSeconds), TEST_LOCATION);
-
// Apply to an actor
Actor actor = Actor::New();
DALI_TEST_EQUALS( actor.GetCurrentPosition(), targetPosition, TEST_LOCATION );
// Remove from the actor
-
actor.RemoveConstraints(); // should go back to source position
application.SendNotification();
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 20% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 twentyPercentBack( targetPosition * 0.8f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), twentyPercentBack, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 40% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 fourtyPercentBack( targetPosition * 0.6f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), fourtyPercentBack, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 60% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 sixtyPercentBack( targetPosition * 0.4f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sixtyPercentBack, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 80% removal progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 eightyPercentBack( targetPosition * 0.2f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), eightyPercentBack, TEST_LOCATION );
+ application.Render(static_cast<unsigned int>(1000.0f));
// Constraint should be fully removed
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* 100% removal progress */);
DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
- // Constraint should still be fully applied
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* Still 100% removal progress */);
+ // Constraint should still be fully removed
+ application.Render(static_cast<unsigned int>(1000.0f)/* Still 100% removal progress */);
DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
// Check that nothing has changed after a couple of buffer swaps
{
TestApplication application;
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR, TestConstraint() );
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::COLOR, TestConstraint() );
DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION);
constraint.SetRemoveAction(Constraint::Discard);
}
/**
- * Test a constraint with non-zero apply-time and remove-time, where the constraint is removed during the apply-time
- */
-int UtcDaliConstraintRemoveDuringApply(void)
-{
- TestApplication application;
-
- Vector3 sourcePosition(0.0f, 0.0f, 0.0f);
- Vector3 targetPosition(100.0f, 100.0f, 100.0f);
- Vector3 halfwayPosition(targetPosition * 0.5f);
-
- // Build constraint
-
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, TestPositionConstraint(targetPosition) );
- DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION);
-
- float applySeconds(4.0f);
- constraint.SetApplyTime(applySeconds);
- DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(applySeconds), TEST_LOCATION);
-
- float removeSeconds(8.0f);
- constraint.SetRemoveTime(removeSeconds);
- DALI_TEST_EQUALS(constraint.GetRemoveTime(), TimePeriod(removeSeconds), TEST_LOCATION);
-
- // Apply to an actor
-
- Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
-
- actor.ApplyConstraint( constraint );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(applySeconds*250.0f)/* 25% progress */);
-
- // Constraint shouldn't be fully applied yet
- Vector3 twentyFivePercent( targetPosition * 0.25f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), twentyFivePercent, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(applySeconds*250.0f)/* 50% progress */);
-
- // Constraint shouldn't be fully applied yet
- Vector3 fiftyPercent( targetPosition * 0.5f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), fiftyPercent, TEST_LOCATION );
-
- // Remove from the actor
-
- actor.RemoveConstraints(); // should go back to source position
-
- application.SendNotification();
- application.Render(static_cast<unsigned int>(removeSeconds*100.0f)/* 50% - 5% = 45% progress */);
-
- // Constraint shouldn't be fully removed yet
- Vector3 fourtyFivePercent( targetPosition * 0.45f );
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), fourtyFivePercent, TEST_LOCATION );
-
- application.Render(static_cast<unsigned int>(removeSeconds*400.0f)/* 50% - 25% = 25% progress */);
-
- // Constraint shouldn't be fully removed yet
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), twentyFivePercent, TEST_LOCATION );
-
- // Constraint should be fully removed
- application.Render(static_cast<unsigned int>(removeSeconds*500.0f)/* 0% progress */);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
-
- // Constraint should still be fully applied
- application.Render(static_cast<unsigned int>(removeSeconds*200.0f)/* Still 0% progress */);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
-
- // Check that nothing has changed after a couple of buffer swaps
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
- application.Render(0);
- DALI_TEST_EQUALS( actor.GetCurrentPosition(), sourcePosition, TEST_LOCATION );
- END_TEST;
-}
-
-/**
* Test a constraint with non-zero apply-time & zero (immediate) remove-time, where the constraint is removed during the apply-time
*/
int UtcDaliConstraintImmediateRemoveDuringApply(void)
// Build constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, TestPositionConstraint(targetPosition) );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION, TestPositionConstraint(targetPosition) );
DALI_TEST_EQUALS((unsigned int)constraint.GetRemoveAction(), (unsigned int)Constraint::Bake, TEST_LOCATION);
float applySeconds(4.0f);
constraint.SetApplyTime(applySeconds);
DALI_TEST_EQUALS(constraint.GetApplyTime(), TimePeriod(applySeconds), TEST_LOCATION);
- DALI_TEST_EQUALS(constraint.GetRemoveTime(), TimePeriod(0.0f), TEST_LOCATION);
// Apply to an actor
// Build constraint, to make child 20% of parent size
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
+ ParentSource( Actor::Property::SIZE ),
TestRelativeConstraintVector3(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::SIZE), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make child 20% of parent width
- Constraint constraint = Constraint::New<float>( Actor::SIZE_WIDTH,
- ParentSource( Actor::SIZE_WIDTH ),
+ Constraint constraint = Constraint::New<float>( Actor::Property::SIZE_WIDTH,
+ ParentSource( Actor::Property::SIZE_WIDTH ),
TestRelativeConstraintFloat(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::SIZE), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make child 20% of parent height
- Constraint constraint = Constraint::New<float>( Actor::SIZE_HEIGHT,
- ParentSource( Actor::SIZE_HEIGHT ),
+ Constraint constraint = Constraint::New<float>( Actor::Property::SIZE_HEIGHT,
+ ParentSource( Actor::Property::SIZE_HEIGHT ),
TestRelativeConstraintFloat(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::SIZE), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make child 20% of parent height
- Constraint constraint = Constraint::New<float>( Actor::SIZE_DEPTH,
- ParentSource( Actor::SIZE_DEPTH ),
+ Constraint constraint = Constraint::New<float>( Actor::Property::SIZE_DEPTH,
+ ParentSource( Actor::Property::SIZE_DEPTH ),
TestRelativeConstraintFloat(0.2f) );
// Apply to a child actor
float durationSeconds(10.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(parent, Actor::SIZE), targetParentSize );
+ animation.AnimateTo( Property(parent, Actor::Property::SIZE), targetParentSize );
animation.Play();
application.SendNotification();
// Build constraint, to make actor track the world-position of another actor
// Note that the world-position is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION,
- Source( child, Actor::WORLD_POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+ Source( child, Actor::Property::WORLD_POSITION ),
EqualToConstraint() );
trackingActor.ApplyConstraint( constraint );
// Move the actors and try again
Vector3 relativePosition( 5, 5, 5 );
- parent.MoveBy( relativePosition );
+ parent.TranslateBy( relativePosition );
application.SendNotification();
application.Render(0);
Actor parent = Actor::New();
Radian rotationAngle( Degree(90.0f) );
Quaternion rotation( rotationAngle, Vector3::YAXIS );
- parent.SetRotation( rotation );
+ parent.SetOrientation( rotation );
Stage::GetCurrent().Add( parent );
Actor child = Actor::New();
- child.SetRotation( rotation );
+ child.SetOrientation( rotation );
parent.Add( child );
Actor trackingActor = Actor::New();
Stage::GetCurrent().Add( trackingActor );
// The actors should not have a world rotation yet
- DALI_TEST_EQUALS( parent.GetCurrentWorldRotation(), Quaternion(0.0f, Vector3::YAXIS), 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( child.GetCurrentWorldRotation(), Quaternion(0.0f, Vector3::YAXIS), 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentWorldOrientation(), Quaternion(0.0f, Vector3::YAXIS), 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentWorldOrientation(), Quaternion(0.0f, Vector3::YAXIS), 0.001, TEST_LOCATION );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( parent.GetCurrentRotation(), rotation, 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( child.GetCurrentRotation(), rotation, 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( trackingActor.GetCurrentRotation(), Quaternion(0.0f, Vector3::YAXIS), 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentOrientation(), rotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentOrientation(), rotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( trackingActor.GetCurrentOrientation(), Quaternion(0.0f, Vector3::YAXIS), 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( parent.GetCurrentWorldRotation(), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentWorldOrientation(), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION );
Quaternion previousRotation( rotationAngle * 2.0f, Vector3::YAXIS );
- DALI_TEST_EQUALS( child.GetCurrentWorldRotation(), previousRotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentWorldOrientation(), previousRotation, 0.001, TEST_LOCATION );
// Build constraint, to make actor track the world-rotation of another actor
// Note that the world-rotation is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Quaternion>( Actor::ROTATION,
- Source( child, Actor::WORLD_ROTATION ),
+ Constraint constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
+ Source( child, Actor::Property::WORLD_ORIENTATION ),
EqualToQuaternion() );
trackingActor.ApplyConstraint( constraint );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( trackingActor.GetCurrentRotation(), previousRotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( trackingActor.GetCurrentOrientation(), previousRotation, 0.001, TEST_LOCATION );
// Rotate the actors and try again
parent.RotateBy( rotation );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( parent.GetCurrentRotation(), rotation * rotation, 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( child.GetCurrentRotation(), rotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentOrientation(), rotation * rotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentOrientation(), rotation, 0.001, TEST_LOCATION );
// The tracking actor lags behind
- DALI_TEST_EQUALS( trackingActor.GetCurrentRotation(), previousRotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( trackingActor.GetCurrentOrientation(), previousRotation, 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( parent.GetCurrentWorldRotation(), Quaternion( rotationAngle * 2.0f, Vector3::YAXIS ), 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentWorldOrientation(), Quaternion( rotationAngle * 2.0f, Vector3::YAXIS ), 0.001, TEST_LOCATION );
previousRotation = Quaternion( rotationAngle * 3.0f, Vector3::YAXIS );
- DALI_TEST_EQUALS( child.GetCurrentWorldRotation(), previousRotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentWorldOrientation(), previousRotation, 0.001, TEST_LOCATION );
// Allow the tracking actor to catch up
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( parent.GetCurrentRotation(), rotation * rotation, 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( child.GetCurrentRotation(), rotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentOrientation(), rotation * rotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentOrientation(), rotation, 0.001, TEST_LOCATION );
// The tracking actor catches up!
- DALI_TEST_EQUALS( trackingActor.GetCurrentRotation(), previousRotation, 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( parent.GetCurrentWorldRotation(), Quaternion( rotationAngle * 2.0f, Vector3::YAXIS ), 0.001, TEST_LOCATION );
- DALI_TEST_EQUALS( child.GetCurrentWorldRotation(), previousRotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( trackingActor.GetCurrentOrientation(), previousRotation, 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentWorldOrientation(), Quaternion( rotationAngle * 2.0f, Vector3::YAXIS ), 0.001, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentWorldOrientation(), previousRotation, 0.001, TEST_LOCATION );
END_TEST;
}
// Build constraint, to make actor track the world-scale of another actor
// Note that the world-scale is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- Source( child, Actor::WORLD_SCALE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
+ Source( child, Actor::Property::WORLD_SCALE ),
EqualToConstraint() );
trackingActor.ApplyConstraint( constraint );
// Build constraint, to make actor track the world-color of another actor
// Note that the world-color is always from the previous frame, so the tracking actor will lag behind
- Constraint constraint = Constraint::New<Vector4>( Actor::COLOR,
- Source( child, Actor::WORLD_COLOR ),
+ Constraint constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
+ Source( child, Actor::Property::WORLD_COLOR ),
EqualToVector4() );
trackingActor.ApplyConstraint( constraint );
{
TestApplication application;
Actor actor = Actor::New();
- Constraint constraint = Constraint::New<Vector3>( Actor::POSITION, LocalSource( PROPERTY_REGISTRATION_START_INDEX ), MultiplyConstraint() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION, LocalSource( PROPERTY_REGISTRATION_START_INDEX ), EqualToConstraint() );
Stage::GetCurrent().Add( actor );
}
catch ( DaliException& e )
{
- DALI_TEST_ASSERT( e, "mTargetProxy->IsPropertyAConstraintInput( source.propertyIndex )", TEST_LOCATION );
+ DALI_TEST_ASSERT( e, "mTargetObject->IsPropertyAConstraintInput( source.propertyIndex )", TEST_LOCATION );
}
END_TEST;
}
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), EqualToConstraint() );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() );
actor.ApplyConstraint( constraint );
application.SendNotification();
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE, ParentSource( Actor::SIZE ), RelativeToConstraint( scale ) );
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), RelativeToConstraint( scale ) );
actor.ApplyConstraint( constraint );
application.SendNotification();
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
+ LocalSource( Actor::Property::SIZE ),
+ ParentSource( Actor::Property::SIZE ),
ScaleToFitConstraint() );
actor.ApplyConstraint( constraint );
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
+ LocalSource( Actor::Property::SIZE ),
+ ParentSource( Actor::Property::SIZE ),
ScaleToFitKeepAspectRatioConstraint() );
actor.ApplyConstraint( constraint );
END_TEST;
}
-int UtcDaliBuiltinConstraintScaleToFillKeepAspectRatio(void)
-{
- TestApplication application;
-
- Actor parent = Actor::New();
- Vector3 parentSize1( 10, 10, 10 );
- parent.SetSize( parentSize1 );
- Stage::GetCurrent().Add( parent );
-
- Actor actor = Actor::New();
- Vector3 childSize( 4, 5, 5 );
- actor.SetSize( childSize );
- parent.Add( actor );
-
- application.SendNotification();
- application.Render(0);
- Vector3 childScale1( 1.0f, 1.0f, 1.0f );
- DALI_TEST_EQUALS( actor.GetCurrentScale(), childScale1, TEST_LOCATION );
-
- // Apply constraint
-
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
- ScaleToFillKeepAspectRatioConstraint() );
- actor.ApplyConstraint( constraint );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied, but parent size is larger than child
- float val = 10.f / 4.f;
- Vector3 childScale2( val, val, val );
- DALI_TEST_EQUALS( actor.GetCurrentScale(), childScale2, TEST_LOCATION );
-
- // change parent size
- Vector3 parentSize2( 40, 50, 50 );
- parent.SetSize( parentSize2 );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied, but parent size is larger than child
- Vector3 childScale3( 10.0f, 10.0f, 10.0f );
- DALI_TEST_EQUALS( actor.GetCurrentScale(), childScale3, TEST_LOCATION );
- END_TEST;
-}
int UtcDaliBuiltinConstraintScaleToFillXYKeepAspectRatio(void)
{
// Apply constraint
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
+ LocalSource( Actor::Property::SIZE ),
+ ParentSource( Actor::Property::SIZE ),
ScaleToFillXYKeepAspectRatioConstraint() );
actor.ApplyConstraint( constraint );
END_TEST;
}
-int UtcDaliBuiltinConstraintShrinkInsideKeepAspectRatioConstraint(void)
-{
- TestApplication application;
-
- Actor parent = Actor::New();
- Vector3 parentSize1( 10, 10, 10 );
- parent.SetSize( parentSize1 );
- Stage::GetCurrent().Add( parent );
-
- Actor actor = Actor::New();
- Vector3 childSize( 4, 5, 5 );
- actor.SetSize( childSize );
- parent.Add( actor );
-
- application.SendNotification();
- application.Render(0);
- Vector3 childScale1( 1.0f, 1.0f, 1.0f );
- DALI_TEST_EQUALS( actor.GetCurrentScale(), childScale1, TEST_LOCATION );
-
- // Apply constraint
-
- Constraint constraint = Constraint::New<Vector3>( Actor::SCALE,
- LocalSource( Actor::SIZE ),
- ParentSource( Actor::SIZE ),
- ShrinkInsideKeepAspectRatioConstraint() );
- actor.ApplyConstraint( constraint );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied, but parent size is larger than child
- Vector3 childScale2( 1.0f, 1.0f, 1.0f );
- DALI_TEST_EQUALS( actor.GetCurrentScale(), childScale2, TEST_LOCATION );
-
- // change parent size
- Vector3 parentSize2( 40, 50, 50 );
- parent.SetSize( parentSize2 );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied, but parent size is larger than child
- Vector3 childScale3( 1.0f, 1.0f, 1.0f );
- DALI_TEST_EQUALS( actor.GetCurrentScale(), childScale3, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliBuiltinConstraintMultiplyConstraint(void)
-{
- TestApplication application;
-
- Actor actor1 = Actor::New();
- Vector3 startPosition( 10, 10, 10 );
- actor1.SetPosition( startPosition );
- Stage::GetCurrent().Add( actor1 );
-
- Actor actor2 = Actor::New();
- Vector3 startSize( 100, 100, 100 );
- actor2.SetSize( startSize );
- Stage::GetCurrent().Add( actor2 );
-
- application.SendNotification();
- application.Render(0);
- DALI_TEST_CHECK( actor1.GetCurrentPosition() == startPosition );
- DALI_TEST_CHECK( actor2.GetCurrentSize() == startSize );
-
- // Apply constraint - multiply actor1 size by actor2 position
-
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( actor1, Actor::POSITION ),
- MultiplyConstraint() );
- constraint.SetRemoveAction( Constraint::Discard );
- actor2.ApplyConstraint( constraint );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied
- Vector3 size( startSize * startPosition );
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
-
- // Change the multiply input
- Vector3 endPosition( 2, 2, 2 );
- actor1.SetPosition( endPosition );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied
- size = Vector3( startSize * endPosition );
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
- application.Render(0);
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliBuiltinConstraintDivideConstraint(void)
-{
- TestApplication application;
-
- Actor actor1 = Actor::New();
- Vector3 startPosition( 10, 10, 10 );
- actor1.SetPosition( startPosition );
- Stage::GetCurrent().Add( actor1 );
-
- Actor actor2 = Actor::New();
- Vector3 startSize( 100, 100, 100 );
- actor2.SetSize( startSize );
- Stage::GetCurrent().Add( actor2 );
-
- application.SendNotification();
- application.Render(0);
- DALI_TEST_CHECK( actor1.GetCurrentPosition() == startPosition );
- DALI_TEST_CHECK( actor2.GetCurrentSize() == startSize );
-
- // Apply constraint - divide actor1 size by actor2 position
-
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( actor1, Actor::POSITION ),
- DivideConstraint() );
- constraint.SetRemoveAction( Constraint::Discard );
- actor2.ApplyConstraint( constraint );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied
- Vector3 size( 10, 10, 10 ); // startSize / startPosition
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
-
- // Change the divide input
- Vector3 endPosition( 2, 2, 2 );
- actor1.SetPosition( endPosition );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied
- size = Vector3( 50, 50, 50 ); // startSize / endPosition
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
- application.Render(0);
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
- END_TEST;
-}
-
int UtcDaliBuiltinConstraintEqualToConstraint(void)
{
TestApplication application;
// Apply constraint - actor1 size == actor2 position
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( actor1, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
+ Source( actor1, Actor::Property::POSITION ),
EqualToConstraint() );
constraint.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint );
DALI_TEST_EQUALS( actor1.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
DALI_TEST_EQUALS( actor2.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
- Constraint constraint2 = Constraint::New<float>( Actor::COLOR_ALPHA,
- Source( actor1, Actor::COLOR_ALPHA ),
+ Constraint constraint2 = Constraint::New<float>( Actor::Property::COLOR_ALPHA,
+ Source( actor1, Actor::Property::COLOR_ALPHA ),
EqualToConstraint() );
constraint2.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint2 );
DALI_TEST_CHECK( actor1.GetCurrentColor() == Color::GREEN );
DALI_TEST_CHECK( actor2.GetCurrentColor() == Color::RED );
- Constraint constraint3 = Constraint::New<Vector4>( Actor::COLOR,
- Source( actor1, Actor::COLOR ),
+ Constraint constraint3 = Constraint::New<Vector4>( Actor::Property::COLOR,
+ Source( actor1, Actor::Property::COLOR ),
EqualToConstraint() );
constraint3.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint3 );
//
Quaternion q1 = Quaternion( Math::PI_2, Vector3::XAXIS );
Quaternion q2 = Quaternion( Math::PI_4, Vector3::YAXIS );
- actor1.SetRotation( q1 );
- actor2.SetRotation( q2 );
+ actor1.SetOrientation( q1 );
+ actor2.SetOrientation( q2 );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor1.GetCurrentRotation(), q1, 0.01, TEST_LOCATION );
- DALI_TEST_EQUALS( actor2.GetCurrentRotation(), q2, 0.01, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor1.GetCurrentOrientation(), q1, 0.01, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2.GetCurrentOrientation(), q2, 0.01, TEST_LOCATION );
- Constraint constraint4 = Constraint::New<Quaternion>( Actor::ROTATION,
- Source( actor1, Actor::ROTATION ),
+ Constraint constraint4 = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
+ Source( actor1, Actor::Property::ORIENTATION ),
EqualToConstraint() );
constraint4.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint4 );
application.SendNotification();
application.Render(0);
- DALI_TEST_EQUALS( actor2.GetCurrentRotation(), q1, 0.01, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor2.GetCurrentOrientation(), q1, 0.01, TEST_LOCATION );
//
// Check Matrix3 variant
RelativeToConstraint( 0.f );
Vector3 scale( 0.5, 0.6, 0.7 );
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( actor1, Actor::POSITION ),
+ Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
+ Source( actor1, Actor::Property::POSITION ),
RelativeToConstraint( scale ) );
constraint.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint( constraint );
DALI_TEST_EQUALS( actor1.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
DALI_TEST_EQUALS( actor2.GetCurrentOpacity(), startOpacity, TEST_LOCATION );
- Constraint constraint2 = Constraint::New<float>( Actor::COLOR_ALPHA,
- Source( actor1, Actor::COLOR_ALPHA ),
+ Constraint constraint2 = Constraint::New<float>( Actor::Property::COLOR_ALPHA,
+ Source( actor1, Actor::Property::COLOR_ALPHA ),
RelativeToConstraintFloat(scale2) );
constraint2.SetRemoveAction( Constraint::Discard );
actor2.ApplyConstraint(constraint2);
END_TEST;
}
-int UtcDaliBuiltinConstraintInverseOfConstraint(void)
-{
- TestApplication application;
-
- Actor actor1 = Actor::New();
- Vector3 startPosition( 10, 10, 10 );
- actor1.SetPosition( startPosition );
- Stage::GetCurrent().Add( actor1 );
-
- Actor actor2 = Actor::New();
- Vector3 startSize( 100, 100, 100 );
- actor2.SetSize( startSize );
- Stage::GetCurrent().Add( actor2 );
-
- application.SendNotification();
- application.Render(0);
- DALI_TEST_CHECK( actor1.GetCurrentPosition() == startPosition );
- DALI_TEST_CHECK( actor2.GetCurrentSize() == startSize );
-
- // Apply constraint - actor1 size == ( 1 / actor2 position )
-
- Constraint constraint = Constraint::New<Vector3>( Actor::SIZE,
- Source( actor1, Actor::POSITION ),
- InverseOfConstraint() );
- constraint.SetRemoveAction( Constraint::Discard );
- actor2.ApplyConstraint( constraint );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied
- Vector3 size( 0.1, 0.1, 0.1 ); // 1 / startPosition
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, 0.00001f, TEST_LOCATION );
-
- // Change the input
- Vector3 endPosition( 2, 2, 2 );
- actor1.SetPosition( endPosition );
-
- application.SendNotification();
- application.Render(0);
-
- // Constraint should be fully applied
- size = Vector3( 0.5, 0.5, 0.5 ); // 1 / endPosition
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
- application.Render(0);
- DALI_TEST_EQUALS( actor2.GetCurrentSize(), size, TEST_LOCATION );
- END_TEST;
-}
-
int UtcDaliBuiltinConstraintFunctions(void)
{
TestApplication application;
}
}
- {
- SourceHeightFixedWidth sourceHeightFixedWidth( 10.f );
- Vector3 current;
- {
- Vector3 reference(10,1,0);
- Vector3 value = sourceHeightFixedWidth( current, PropertyInputAbstraction(Vector3::ONE) );
- DALI_TEST_EQUALS( reference, value, TEST_LOCATION );
- }
- {
- Vector3 reference(10,10,0);
- Vector3 value = sourceHeightFixedWidth( current, PropertyInputAbstraction(Vector3::ONE*10.f) );
- DALI_TEST_EQUALS( reference, value, TEST_LOCATION );
- }
- {
- Vector3 reference(10,100,0);
- Vector3 value = sourceHeightFixedWidth( current, PropertyInputAbstraction(Vector3::ONE*100.f) );
- DALI_TEST_EQUALS( reference, value, TEST_LOCATION );
- }
- }
-
{ // LookAt
Quaternion current(0, Vector3::YAXIS);
PropertyInputAbstraction target(Vector3::ZAXIS);
DALI_TEST_EQUALS( reference, value, 0.001, TEST_LOCATION );
}
- {
- OrientedLookAt orientedLookAt(90.f);
- Quaternion reference(.525322, 0., 0., 0.850904);
- Quaternion value = orientedLookAt( current, target, camera, targetRotation );
- DALI_TEST_EQUALS( reference, value, 0.001, TEST_LOCATION );
- }
}
END_TEST;