X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali%2Futc-Dali-Actor.cpp;h=55f2ac10f9393e129ae65ef5988e61785016721a;hb=e514bbbb75cb67bd9ce1435554659628a625f128;hp=12cbecd6ad9ec3c8c1880f198a09a11dbfd477af;hpb=9cdd13f843eee89f23292cdbc1f62eff27d6c946;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 12cbecd..55f2ac1 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -15,6 +15,9 @@ * */ +// Enable debug log for test coverage +#define DEBUG_ENABLED 1 + #include "assert.h" #include #include @@ -22,6 +25,7 @@ #include #include #include +#include #include #include @@ -132,14 +136,14 @@ static int gOnStageCallBackCalled; void OnStageCallback( Actor actor ) { ++gOnStageCallBackCalled; - gActorNamesOnOffStage.push_back( actor.GetName() ); + gActorNamesOnOffStage.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) ); DALI_TEST_CHECK( actor.OnStage() == true ); } static int gOffStageCallBackCalled; void OffStageCallback( Actor actor ) { ++gOffStageCallBackCalled; - gActorNamesOnOffStage.push_back( actor.GetName() ); + gActorNamesOnOffStage.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) ); DALI_TEST_CHECK( actor.OnStage() == false ); } @@ -176,7 +180,7 @@ static std::vector< std::string > gActorNamesRelayout; void OnRelayoutCallback( Actor actor ) { gOnRelayoutCallBackCalled = true; - gActorNamesRelayout.push_back( actor.GetName() ); + gActorNamesRelayout.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) ); } struct VisibilityChangedFunctorData @@ -326,7 +330,7 @@ int UtcDaliActorGetName(void) Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetName().empty()); + DALI_TEST_CHECK(actor.GetProperty< std::string >( Actor::Property::NAME ).empty()); END_TEST; } @@ -338,8 +342,8 @@ int UtcDaliActorSetName(void) string str("ActorName"); Actor actor = Actor::New(); - actor.SetName(str); - DALI_TEST_CHECK(actor.GetName() == str); + actor.SetProperty( Actor::Property::NAME,str); + DALI_TEST_CHECK(actor.GetProperty< std::string >( Actor::Property::NAME ) == str); END_TEST; } @@ -748,25 +752,25 @@ int UtcDaliActorSetParentOrigin(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentParentOrigin()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); - actor.SetParentOrigin(vector); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, vector ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentParentOrigin()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); Stage::GetCurrent().Add( actor ); - actor.SetParentOrigin( Vector3( 0.1f, 0.2f, 0.3f ) ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.1f, 0.2f, 0.3f ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentParentOrigin(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), TEST_LOCATION ); Stage::GetCurrent().Remove( actor ); END_TEST; @@ -779,7 +783,7 @@ int UtcDaliActorSetParentOriginIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentParentOrigin()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); actor.SetProperty( Actor::Property::PARENT_ORIGIN_X, vector.x ); @@ -787,7 +791,7 @@ int UtcDaliActorSetParentOriginIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentParentOrigin().x, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).x, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN_Y, vector.y ); @@ -795,7 +799,7 @@ int UtcDaliActorSetParentOriginIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentParentOrigin().y, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).y, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN_Z, vector.z ); @@ -803,7 +807,7 @@ int UtcDaliActorSetParentOriginIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentParentOrigin().z, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).z, TEST_LOCATION ); END_TEST; } @@ -815,15 +819,15 @@ int UtcDaliActorGetCurrentParentOrigin(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentParentOrigin()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); - actor.SetParentOrigin(vector); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, vector ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentParentOrigin()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN )); END_TEST; } @@ -834,24 +838,24 @@ int UtcDaliActorSetAnchorPoint(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentAnchorPoint()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); - actor.SetAnchorPoint(vector); + actor.SetProperty( Actor::Property::ANCHOR_POINT, vector ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentAnchorPoint()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); Stage::GetCurrent().Add( actor ); - actor.SetAnchorPoint( Vector3( 0.1f, 0.2f, 0.3f ) ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, Vector3( 0.1f, 0.2f, 0.3f ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentAnchorPoint(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), TEST_LOCATION ); Stage::GetCurrent().Remove( actor ); END_TEST; @@ -864,7 +868,7 @@ int UtcDaliActorSetAnchorPointIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentAnchorPoint()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); actor.SetProperty( Actor::Property::ANCHOR_POINT_X, vector.x ); @@ -872,7 +876,7 @@ int UtcDaliActorSetAnchorPointIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentAnchorPoint().x, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).x, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT_Y, vector.y ); @@ -880,7 +884,7 @@ int UtcDaliActorSetAnchorPointIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentAnchorPoint().y, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).y, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT_Z, vector.z ); @@ -888,7 +892,7 @@ int UtcDaliActorSetAnchorPointIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentAnchorPoint().z, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).z, TEST_LOCATION ); END_TEST; } @@ -900,19 +904,18 @@ int UtcDaliActorGetCurrentAnchorPoint(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentAnchorPoint()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); - actor.SetAnchorPoint(vector); + actor.SetProperty( Actor::Property::ANCHOR_POINT, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentAnchorPoint()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT )); END_TEST; } -// SetSize(float width, float height) int UtcDaliActorSetSize01(void) { TestApplication application; @@ -920,9 +923,9 @@ int UtcDaliActorSetSize01(void) Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); - actor.SetSize(vector.x, vector.y); + actor.SetProperty( Actor::Property::SIZE, Vector2( vector.x, vector.y ) ); // Immediately retrieve the size after setting Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); @@ -936,7 +939,7 @@ int UtcDaliActorSetSize01(void) application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentSize()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -958,7 +961,7 @@ int UtcDaliActorSetSize01(void) DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); // Set a new size after resize policy is changed and check the new size - actor.SetSize( Vector3( 0.1f, 0.2f, 0.0f ) ); + actor.SetProperty( Actor::Property::SIZE, Vector3( 0.1f, 0.2f, 0.0f ) ); currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.0f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -970,7 +973,7 @@ int UtcDaliActorSetSize01(void) DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.0f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); // Set another new size after resize policy is changed and check the new size - actor.SetSize( Vector3( 50.0f, 60.0f, 0.0f ) ); + actor.SetProperty( Actor::Property::SIZE, Vector3( 50.0f, 60.0f, 0.0f ) ); currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); DALI_TEST_EQUALS( currentSize, Vector3( 50.0f, 60.0f, 0.0f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -978,7 +981,6 @@ int UtcDaliActorSetSize01(void) END_TEST; } -// SetSize(float width, float height, float depth) int UtcDaliActorSetSize02(void) { TestApplication application; @@ -986,9 +988,9 @@ int UtcDaliActorSetSize02(void) Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); - actor.SetSize(vector.x, vector.y, vector.z); + actor.SetProperty( Actor::Property::SIZE, Vector3( vector.x, vector.y, vector.z ) ); // Immediately check the size after setting Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); @@ -999,7 +1001,7 @@ int UtcDaliActorSetSize02(void) application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentSize()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -1015,9 +1017,9 @@ int UtcDaliActorSetSize03(void) Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); - actor.SetSize(Vector2(vector.x, vector.y)); + actor.SetProperty( Actor::Property::SIZE,Vector2(vector.x, vector.y)); // Immediately check the size after setting Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); @@ -1028,7 +1030,7 @@ int UtcDaliActorSetSize03(void) application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentSize()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); DALI_TEST_EQUALS( currentSize, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -1044,9 +1046,9 @@ int UtcDaliActorSetSize04(void) Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); - actor.SetSize(vector); + actor.SetProperty( Actor::Property::SIZE,vector); // Immediately check the size after setting Vector3 currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); @@ -1057,10 +1059,10 @@ int UtcDaliActorSetSize04(void) application.Render(); // Check the size in the new frame - DALI_TEST_CHECK(vector == actor.GetCurrentSize()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); Stage::GetCurrent().Add( actor ); - actor.SetSize( Vector3( 0.1f, 0.2f, 0.3f ) ); + actor.SetProperty( Actor::Property::SIZE, Vector3( 0.1f, 0.2f, 0.3f ) ); // Immediately check the size after setting currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); @@ -1071,7 +1073,7 @@ int UtcDaliActorSetSize04(void) application.Render(); // Check the size in the new frame - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentSize(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), TEST_LOCATION ); currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.3f ), Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -1087,7 +1089,7 @@ int UtcDaliActorSetSizeIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); actor.SetProperty( Actor::Property::SIZE_WIDTH, vector.width ); @@ -1100,7 +1102,7 @@ int UtcDaliActorSetSizeIndividual(void) application.Render(); // Check the width in the new frame - DALI_TEST_EQUALS( vector.width, actor.GetCurrentSize().width, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.width, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, TEST_LOCATION ); sizeWidth = actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(); DALI_TEST_EQUALS( sizeWidth, vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -1116,7 +1118,7 @@ int UtcDaliActorSetSizeIndividual(void) application.Render(); // Check the height in the new frame - DALI_TEST_EQUALS( vector.height, actor.GetCurrentSize().height, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.height, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, TEST_LOCATION ); sizeHeight = actor.GetProperty( Actor::Property::SIZE_HEIGHT ).Get< float >(); DALI_TEST_EQUALS( sizeHeight, vector.height, Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -1132,7 +1134,7 @@ int UtcDaliActorSetSizeIndividual(void) application.Render(); // Check the depth in the new frame - DALI_TEST_EQUALS( vector.depth, actor.GetCurrentSize().depth, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.depth, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).depth, TEST_LOCATION ); sizeDepth = actor.GetProperty( Actor::Property::SIZE_DEPTH ).Get< float >(); DALI_TEST_EQUALS( sizeDepth, vector.depth, Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -1173,7 +1175,7 @@ int UtcDaliActorSetSizeIndividual02(void) Stage::GetCurrent().Add( actor ); Vector3 vector( 100.0f, 200.0f, 400.0f ); - DALI_TEST_CHECK( vector != actor.GetCurrentSize() ); + DALI_TEST_CHECK( vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) ); actor.SetProperty( Actor::Property::SIZE_WIDTH, vector.width ); DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_WIDTH ).Get< float >(), vector.width, Math::MACHINE_EPSILON_0, TEST_LOCATION ); @@ -1189,8 +1191,8 @@ int UtcDaliActorSetSizeIndividual02(void) application.Render(); // Check the width in the new frame - DALI_TEST_EQUALS( vector.width, actor.GetCurrentSize().width, TEST_LOCATION ); - DALI_TEST_EQUALS( vector.height, actor.GetCurrentSize().height, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.width, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.height, actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, TEST_LOCATION ); END_TEST; } @@ -1203,15 +1205,15 @@ int UtcDaliActorGetCurrentSize(void) Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 20.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); - actor.SetSize(vector); + actor.SetProperty( Actor::Property::SIZE,vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentSize()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); END_TEST; } @@ -1235,19 +1237,19 @@ int UtcDaliActorGetCurrentSizeImmediate(void) Vector3 vector(100.0f, 100.0f, 20.0f); DALI_TEST_CHECK(vector != actor.GetTargetSize()); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); - actor.SetSize(vector); + actor.SetProperty( Actor::Property::SIZE,vector); DALI_TEST_CHECK(vector == actor.GetTargetSize()); - DALI_TEST_CHECK(vector != actor.GetCurrentSize()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); // flush the queue and render once application.SendNotification(); application.Render(); DALI_TEST_CHECK(vector == actor.GetTargetSize()); - DALI_TEST_CHECK(vector == actor.GetCurrentSize()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE )); // Animation // Build the animation @@ -1275,8 +1277,8 @@ int UtcDaliActorCalculateScreenExtents(void) Actor actor = Actor::New(); - actor.SetPosition(Vector3(2.0f, 2.0f, 16.0f)); - actor.SetSize(Vector3{ 1.0f, 1.0f, 1.0f }); + actor.SetProperty( Actor::Property::POSITION, Vector3(2.0f, 2.0f, 16.0f)); + actor.SetProperty( Actor::Property::SIZE,Vector3{ 1.0f, 1.0f, 1.0f }); application.SendNotification(); application.Render(); @@ -1300,38 +1302,38 @@ int UtcDaliActorSetPosition01(void) Actor actor = Actor::New(); // Set to random to start off with - actor.SetPosition(Vector3(120.0f, 120.0f, 0.0f)); + actor.SetProperty( Actor::Property::POSITION, Vector3(120.0f, 120.0f, 0.0f)); Vector3 vector(100.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); - actor.SetPosition(vector.x, vector.y); + actor.SetProperty( Actor::Property::POSITION, Vector2(vector.x, vector.y)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); Stage::GetCurrent().Add( actor ); - actor.SetPosition( Vector3( 0.1f, 0.2f, 0.3f ) ); + actor.SetProperty( Actor::Property::POSITION, Vector3( 0.1f, 0.2f, 0.3f ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); - actor.SetX( 1.0f ); - actor.SetY( 1.1f ); - actor.SetZ( 1.2f ); + actor.SetProperty( Actor::Property::POSITION_X, 1.0f ); + actor.SetProperty( Actor::Property::POSITION_Y, 1.1f ); + actor.SetProperty( Actor::Property::POSITION_Z, 1.2f ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 1.0f, 1.1f, 1.2f ), actor.GetCurrentPosition(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 1.0f, 1.1f, 1.2f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), TEST_LOCATION ); actor.TranslateBy( Vector3( 0.1f, 0.1f, 0.1f ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 1.1f, 1.2f, 1.3f ), actor.GetCurrentPosition(), Math::MACHINE_EPSILON_10000, TEST_LOCATION ); + DALI_TEST_EQUALS( Vector3( 1.1f, 1.2f, 1.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Math::MACHINE_EPSILON_10000, TEST_LOCATION ); Stage::GetCurrent().Remove( actor ); END_TEST; @@ -1345,19 +1347,19 @@ int UtcDaliActorSetPosition02(void) Actor actor = Actor::New(); // Set to random to start off with - actor.SetPosition(Vector3(120.0f, 120.0f, 120.0f)); + actor.SetProperty( Actor::Property::POSITION, Vector3(120.0f, 120.0f, 120.0f)); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); - actor.SetPosition(vector.x, vector.y, vector.z); + actor.SetProperty( Actor::Property::POSITION, Vector3(vector.x, vector.y, vector.z)); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); END_TEST; } @@ -1369,19 +1371,19 @@ int UtcDaliActorSetPosition03(void) Actor actor = Actor::New(); // Set to random to start off with - actor.SetPosition(Vector3(120.0f, 120.0f, 120.0f)); + actor.SetProperty( Actor::Property::POSITION, Vector3(120.0f, 120.0f, 120.0f)); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); - actor.SetPosition(vector); + actor.SetProperty( Actor::Property::POSITION, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); END_TEST; } @@ -1393,15 +1395,15 @@ int UtcDaliActorSetX(void) Vector3 vector(100.0f, 0.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); - actor.SetX(100.0f); + actor.SetProperty( Actor::Property::POSITION_X, 100.0f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); END_TEST; } @@ -1413,15 +1415,15 @@ int UtcDaliActorSetY(void) Vector3 vector(0.0f, 100.0f, 0.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); - actor.SetY(100.0f); + actor.SetProperty( Actor::Property::POSITION_Y, 100.0f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); END_TEST; } @@ -1433,15 +1435,15 @@ int UtcDaliActorSetZ(void) Vector3 vector(0.0f, 0.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); - actor.SetZ(100.0f); + actor.SetProperty( Actor::Property::POSITION_Z, 100.0f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); END_TEST; } @@ -1452,7 +1454,7 @@ int UtcDaliActorSetPositionProperties(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); actor.SetProperty( Actor::Property::POSITION_X, vector.x ); DALI_TEST_EQUALS( vector.x, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); @@ -1462,7 +1464,7 @@ int UtcDaliActorSetPositionProperties(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentPosition().x, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); DALI_TEST_EQUALS( vector.x, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); DALI_TEST_EQUALS( vector.x, actor.GetProperty< float >( Actor::Property::POSITION_X ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, TEST_LOCATION ); @@ -1476,7 +1478,7 @@ int UtcDaliActorSetPositionProperties(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentPosition().y, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, TEST_LOCATION ); DALI_TEST_EQUALS( vector.y, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).y, TEST_LOCATION ); DALI_TEST_EQUALS( vector.y, actor.GetProperty< float >( Actor::Property::POSITION_Y ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, TEST_LOCATION ); @@ -1490,7 +1492,7 @@ int UtcDaliActorSetPositionProperties(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentPosition().z, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, TEST_LOCATION ); DALI_TEST_EQUALS( vector.z, actor.GetProperty< Vector3 >( Actor::Property::POSITION ).z, TEST_LOCATION ); DALI_TEST_EQUALS( vector.z, actor.GetProperty< float >( Actor::Property::POSITION_Z ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, TEST_LOCATION ); @@ -1506,15 +1508,15 @@ int UtcDaliActorTranslateBy(void) Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); - actor.SetPosition(vector); + actor.SetProperty( Actor::Property::POSITION, vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); actor.TranslateBy(vector); @@ -1522,7 +1524,7 @@ int UtcDaliActorTranslateBy(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector*2.0f == actor.GetCurrentPosition()); + DALI_TEST_CHECK(vector*2.0f == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION )); END_TEST; } @@ -1532,13 +1534,13 @@ int UtcDaliActorGetCurrentPosition(void) Actor actor = Actor::New(); Vector3 setVector(100.0f, 100.0f, 0.0f); - actor.SetPosition(setVector); + actor.SetProperty( Actor::Property::POSITION, setVector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentPosition() == setVector); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ) == setVector); END_TEST; } @@ -1548,31 +1550,31 @@ int UtcDaliActorGetCurrentWorldPosition(void) Actor parent = Actor::New(); Vector3 parentPosition( 1.0f, 2.0f, 3.0f ); - parent.SetPosition( parentPosition ); - parent.SetParentOrigin( ParentOrigin::CENTER ); - parent.SetAnchorPoint( AnchorPoint::CENTER ); + parent.SetProperty( Actor::Property::POSITION, parentPosition ); + parent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + parent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); - child.SetParentOrigin( ParentOrigin::CENTER ); - child.SetAnchorPoint( AnchorPoint::CENTER ); + child.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + child.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Vector3 childPosition( 6.0f, 6.0f, 6.0f ); - child.SetPosition( childPosition ); + child.SetProperty( Actor::Property::POSITION, childPosition ); parent.Add( child ); // The actors should not have a world position yet - DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), Vector3::ZERO, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentPosition(), childPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childPosition, TEST_LOCATION ); // The actors should have a world position now - DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), parentPosition + childPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition + childPosition, TEST_LOCATION ); END_TEST; } @@ -1583,54 +1585,54 @@ int UtcDaliActorSetInheritPosition(void) Actor parent = Actor::New(); Vector3 parentPosition( 1.0f, 2.0f, 3.0f ); - parent.SetPosition( parentPosition ); - parent.SetParentOrigin( ParentOrigin::CENTER ); - parent.SetAnchorPoint( AnchorPoint::CENTER ); + parent.SetProperty( Actor::Property::POSITION, parentPosition ); + parent.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + parent.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); - child.SetParentOrigin( ParentOrigin::CENTER ); - child.SetAnchorPoint( AnchorPoint::CENTER ); + child.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + child.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Vector3 childPosition( 10.0f, 11.0f, 12.0f ); - child.SetPosition( childPosition ); + child.SetProperty( Actor::Property::POSITION, childPosition ); parent.Add( child ); // The actors should not have a world position yet - DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), Vector3::ZERO, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3::ZERO, TEST_LOCATION ); // first test default, which is to inherit position - DALI_TEST_EQUALS( child.IsPositionInherited(), true, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_POSITION ), true, TEST_LOCATION ); application.SendNotification(); application.Render(0); // should only really call Update as Render is not required to update scene - DALI_TEST_EQUALS( parent.GetCurrentPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentPosition(), childPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), parentPosition + childPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition + childPosition, TEST_LOCATION ); //Change child position Vector3 childOffset( -1.0f, 1.0f, 0.0f ); - child.SetPosition( childOffset ); + child.SetProperty( Actor::Property::POSITION, childOffset ); // Use local position as world postion - child.SetInheritPosition( false ); - DALI_TEST_EQUALS( child.IsPositionInherited(), false, TEST_LOCATION ); + child.SetProperty( Actor::Property::INHERIT_POSITION, false ); + DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_POSITION ), false, TEST_LOCATION ); application.SendNotification(); application.Render(0); // should only really call Update as Render is not required to update scene - DALI_TEST_EQUALS( parent.GetCurrentPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentPosition(), childOffset, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), childOffset, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childOffset, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), childOffset, TEST_LOCATION ); //Change back to inherit position from parent - child.SetInheritPosition( true ); - DALI_TEST_EQUALS( child.IsPositionInherited(), true, TEST_LOCATION ); + child.SetProperty( Actor::Property::INHERIT_POSITION, true ); + DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_POSITION ), true, TEST_LOCATION ); application.SendNotification(); application.Render(0); // should only really call Update as Render is not required to update scene - DALI_TEST_EQUALS( parent.GetCurrentPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentPosition(), childOffset, TEST_LOCATION ); - DALI_TEST_EQUALS( parent.GetCurrentWorldPosition(), parentPosition, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldPosition(), parentPosition + childOffset, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), childOffset, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), parentPosition + childOffset, TEST_LOCATION ); END_TEST; } @@ -1651,7 +1653,7 @@ int UtcDaliActorInheritOpacity(void) application.SendNotification(); application.Render(); - parent.SetOpacity( 0.1f ); + parent.SetProperty( DevelActor::Property::OPACITY, 0.1f ); DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get(), 0.1f, 0.0001f, TEST_LOCATION ); DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get(), 1.0f, 0.0001f, TEST_LOCATION ); @@ -1677,13 +1679,13 @@ int UtcDaliActorSetOrientation01(void) Quaternion rotation( Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); Actor actor = Actor::New(); - actor.SetOrientation(rotation); + actor.SetProperty( Actor::Property::ORIENTATION, rotation); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); END_TEST; } @@ -1696,29 +1698,29 @@ int UtcDaliActorSetOrientation02(void) Radian angle( 0.785f ); Vector3 axis(1.0f, 1.0f, 0.0f); - actor.SetOrientation( angle, axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( angle, axis ) ); Quaternion rotation( angle, axis ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); Stage::GetCurrent().Add( actor ); actor.RotateBy( Degree( 360 ), axis); - DALI_TEST_EQUALS(rotation, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); - actor.SetOrientation( Degree( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ) ); Quaternion result( Radian( 0 ), Vector3( 1.0f, 0.0f, 0.0f ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( result, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS( result, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); - actor.SetOrientation( angle, axis); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( angle, axis ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); Stage::GetCurrent().Remove( actor ); END_TEST; @@ -1739,7 +1741,7 @@ int UtcDaliActorSetOrientationProperty(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); DALI_TEST_EQUALS(rotation, actor.GetProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); END_TEST; @@ -1757,7 +1759,7 @@ int UtcDaliActorRotateBy01(void) // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Quaternion( angle, Vector3::ZAXIS), actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(Quaternion( angle, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); Stage::GetCurrent().Add( actor ); @@ -1765,7 +1767,7 @@ int UtcDaliActorRotateBy01(void) // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); Stage::GetCurrent().Remove( actor ); END_TEST; @@ -1784,13 +1786,13 @@ int UtcDaliActorRotateBy02(void) // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); actor.RotateBy(rotation); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); END_TEST; } @@ -1800,11 +1802,11 @@ int UtcDaliActorGetCurrentOrientation(void) Actor actor = Actor::New(); Quaternion rotation(Radian(0.785f), Vector3(1.0f, 1.0f, 0.0f)); - actor.SetOrientation(rotation); + actor.SetProperty( Actor::Property::ORIENTATION, rotation ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(rotation, actor.GetCurrentOrientation(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION); END_TEST; } @@ -1816,36 +1818,36 @@ int UtcDaliActorGetCurrentWorldOrientation(void) Actor parent = Actor::New(); Radian rotationAngle( Degree(90.0f) ); Quaternion rotation( rotationAngle, Vector3::YAXIS ); - parent.SetOrientation( rotation ); + parent.SetProperty( Actor::Property::ORIENTATION, rotation ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); - child.SetOrientation( rotation ); + child.SetProperty( Actor::Property::ORIENTATION, rotation ); parent.Add( child ); // The actors should not have a world rotation yet - DALI_TEST_EQUALS( parent.GetCurrentWorldOrientation(), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldOrientation(), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), 0.001, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentOrientation(), rotation, 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentOrientation(), rotation, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), rotation, 0.001, TEST_LOCATION ); // The actors should have a world rotation now - DALI_TEST_EQUALS( parent.GetCurrentWorldOrientation(), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldOrientation(), Quaternion( rotationAngle * 2.0f, Vector3::YAXIS ), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion( rotationAngle * 2.0f, Vector3::YAXIS ), 0.001, TEST_LOCATION ); // turn off child rotation inheritance - child.SetInheritOrientation( false ); - DALI_TEST_EQUALS( child.IsOrientationInherited(), false, TEST_LOCATION ); + child.SetProperty( Actor::Property::INHERIT_ORIENTATION, false ); + DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_ORIENTATION ), false, TEST_LOCATION ); application.SendNotification(); application.Render(0); // The actors should have a world rotation now - DALI_TEST_EQUALS( parent.GetCurrentWorldOrientation(), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldOrientation(), rotation, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), Quaternion( rotationAngle, Vector3::YAXIS ), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::WORLD_ORIENTATION ), rotation, 0.001, TEST_LOCATION ); END_TEST; } @@ -1856,19 +1858,19 @@ int UtcDaliActorSetScale01(void) Actor actor = Actor::New(); - // Set to random value first - GetCurrentScale() asserts if called before SetScale() - actor.SetScale(0.25f); + // Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale() + actor.SetProperty( Actor::Property::SCALE,0.25f); Vector3 scale(10.0f, 10.0f, 10.0f); - DALI_TEST_CHECK(actor.GetCurrentScale() != scale); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) != scale); - actor.SetScale(scale.x); + actor.SetProperty( Actor::Property::SCALE,scale.x); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentScale() == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); END_TEST; } @@ -1880,24 +1882,24 @@ int UtcDaliActorSetScale02(void) Actor actor = Actor::New(); - // Set to random value first - GetCurrentScale() asserts if called before SetScale() - actor.SetScale(Vector3(12.0f, 1.0f, 2.0f)); + // Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale() + actor.SetProperty( Actor::Property::SCALE, Vector3( 12.0f, 1.0f, 2.0f ) ); - DALI_TEST_CHECK(actor.GetCurrentScale() != scale); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) != scale); - actor.SetScale(scale.x, scale.y, scale.z); + actor.SetProperty( Actor::Property::SCALE, Vector3( scale.x, scale.y, scale.z ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentScale() == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); // add to stage and test Stage::GetCurrent().Add( actor ); - actor.SetScale( 2.0f, 2.0f, 2.0f ); + actor.SetProperty( Actor::Property::SCALE, Vector3( 2.0f, 2.0f, 2.0f ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector3( 2.0f, 2.0f, 2.0f ), actor.GetCurrentScale(), 0.001, TEST_LOCATION); + DALI_TEST_EQUALS( Vector3( 2.0f, 2.0f, 2.0f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), 0.001, TEST_LOCATION); Stage::GetCurrent().Remove( actor ); @@ -1912,18 +1914,18 @@ int UtcDaliActorSetScale03(void) Actor actor = Actor::New(); - // Set to random value first - GetCurrentScale() asserts if called before SetScale() - actor.SetScale(Vector3(12.0f, 1.0f, 2.0f)); + // Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale() + actor.SetProperty( Actor::Property::SCALE, Vector3(12.0f, 1.0f, 2.0f)); - DALI_TEST_CHECK(actor.GetCurrentScale() != scale); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) != scale); - actor.SetScale(scale); + actor.SetProperty( Actor::Property::SCALE,scale); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentScale() == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); END_TEST; } @@ -1934,7 +1936,7 @@ int UtcDaliActorSetScaleIndividual(void) Actor actor = Actor::New(); Vector3 vector(0.7f, 0.8f, 0.9f); - DALI_TEST_CHECK(vector != actor.GetCurrentScale()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); actor.SetProperty( Actor::Property::SCALE_X, vector.x ); DALI_TEST_EQUALS( vector.x, actor.GetProperty< float >( Actor::Property::SCALE_X ), TEST_LOCATION ); @@ -1943,7 +1945,7 @@ int UtcDaliActorSetScaleIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.x, actor.GetCurrentScale().x, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x, TEST_LOCATION ); DALI_TEST_EQUALS( vector.x, actor.GetProperty< float >( Actor::Property::SCALE_X ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.x, actor.GetCurrentProperty< float >( Actor::Property::SCALE_X ), TEST_LOCATION ); @@ -1954,7 +1956,7 @@ int UtcDaliActorSetScaleIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.y, actor.GetCurrentScale().y, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).y, TEST_LOCATION ); DALI_TEST_EQUALS( vector.y, actor.GetProperty< float >( Actor::Property::SCALE_Y ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.y, actor.GetCurrentProperty< float >( Actor::Property::SCALE_Y ), TEST_LOCATION ); @@ -1965,7 +1967,7 @@ int UtcDaliActorSetScaleIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.z, actor.GetCurrentScale().z, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).z, TEST_LOCATION ); DALI_TEST_EQUALS( vector.z, actor.GetProperty< float >( Actor::Property::SCALE_Z ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.z, actor.GetCurrentProperty< float >( Actor::Property::SCALE_Z ), TEST_LOCATION ); @@ -1981,15 +1983,15 @@ int UtcDaliActorScaleBy(void) Actor actor = Actor::New(); Vector3 vector(100.0f, 100.0f, 100.0f); - DALI_TEST_CHECK(vector != actor.GetCurrentScale()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); - actor.SetScale(vector); + actor.SetProperty( Actor::Property::SCALE,vector); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector == actor.GetCurrentScale()); + DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); actor.ScaleBy(vector); @@ -1997,7 +1999,7 @@ int UtcDaliActorScaleBy(void) application.SendNotification(); application.Render(); - DALI_TEST_CHECK(vector*100.0f == actor.GetCurrentScale()); + DALI_TEST_CHECK(vector*100.0f == actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE )); END_TEST; } @@ -2008,13 +2010,13 @@ int UtcDaliActorGetCurrentScale(void) Actor actor = Actor::New(); - actor.SetScale(scale); + actor.SetProperty( Actor::Property::SCALE,scale); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentScale() == scale); + DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale); END_TEST; } @@ -2024,31 +2026,31 @@ int UtcDaliActorGetCurrentWorldScale(void) Actor parent = Actor::New(); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetScale( parentScale ); + parent.SetProperty( Actor::Property::SCALE, parentScale ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); Vector3 childScale( 2.0f, 2.0f, 2.0f ); - child.SetScale( childScale ); + child.SetProperty( Actor::Property::SCALE, childScale ); parent.Add( child ); // The actors should not have a scale yet - DALI_TEST_EQUALS( parent.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION ); // The actors should not have a world scale yet - DALI_TEST_EQUALS( parent.GetCurrentWorldScale(), Vector3::ONE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldScale(), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), Vector3::ONE, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), Vector3::ONE, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentScale(), parentScale, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentScale(), childScale, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), parentScale, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), childScale, TEST_LOCATION ); // The actors should have a world scale now - DALI_TEST_EQUALS( parent.GetCurrentWorldScale(), parentScale, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldScale(), parentScale * childScale, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), parentScale, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), parentScale * childScale, TEST_LOCATION ); END_TEST; } @@ -2059,27 +2061,27 @@ int UtcDaliActorInheritScale(void) Actor parent = Actor::New(); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetScale( parentScale ); + parent.SetProperty( Actor::Property::SCALE, parentScale ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); Vector3 childScale( 2.0f, 2.0f, 2.0f ); - child.SetScale( childScale ); + child.SetProperty( Actor::Property::SCALE, childScale ); parent.Add( child ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.IsScaleInherited(), true, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldScale(), parentScale * childScale, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_SCALE ), true, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), parentScale * childScale, TEST_LOCATION ); - child.SetInheritScale( false ); - DALI_TEST_EQUALS( child.IsScaleInherited(), false, TEST_LOCATION ); + child.SetProperty( Actor::Property::INHERIT_SCALE, false ); + DALI_TEST_EQUALS( child.GetProperty< bool >( Actor::Property::INHERIT_SCALE ), false, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.GetCurrentWorldScale(), childScale, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_SCALE ), childScale, TEST_LOCATION ); END_TEST; } @@ -2088,25 +2090,25 @@ int UtcDaliActorSetVisible(void) TestApplication application; Actor actor = Actor::New(); - actor.SetVisible(false); + actor.SetProperty( Actor::Property::VISIBLE,false); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.IsVisible() == false); + DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == false); - actor.SetVisible(true); + actor.SetProperty( Actor::Property::VISIBLE,true); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.IsVisible() == true); + DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == true); // put actor on stage Stage::GetCurrent().Add( actor ); - actor.SetVisible(false); + actor.SetProperty( Actor::Property::VISIBLE,false); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.IsVisible() == false); + DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == false); END_TEST; } @@ -2116,7 +2118,7 @@ int UtcDaliActorIsVisible(void) Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.IsVisible() == true); + DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == true); END_TEST; } @@ -2126,38 +2128,38 @@ int UtcDaliActorSetOpacity(void) Actor actor = Actor::New(); // initial opacity is 1 - DALI_TEST_EQUALS(actor.GetCurrentOpacity(), 1.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION ); - actor.SetOpacity( 0.4f); + actor.SetProperty( DevelActor::Property::OPACITY, 0.4f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentOpacity(), 0.4f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.4f, TEST_LOCATION ); // change opacity, actor is on stage to change is not immediate - actor.SetOpacity( actor.GetCurrentOpacity() + 0.1f ); + actor.SetProperty( DevelActor::Property::OPACITY, actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) + 0.1f ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentOpacity(), 0.5f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.5f, TEST_LOCATION ); // put actor on stage Stage::GetCurrent().Add( actor ); // change opacity, actor is on stage to change is not immediate - actor.SetOpacity( 0.9f ); - DALI_TEST_EQUALS(actor.GetCurrentOpacity(), 0.5f, TEST_LOCATION ); + actor.SetProperty( DevelActor::Property::OPACITY, 0.9f ); + DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.5f, TEST_LOCATION ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentOpacity(), 0.9f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.9f, TEST_LOCATION ); // change opacity, actor is on stage to change is not immediate - actor.SetOpacity( actor.GetCurrentOpacity() - 0.9f ); + actor.SetProperty( DevelActor::Property::OPACITY, actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) - 0.9f ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS(actor.GetCurrentOpacity(), 0.0f, TEST_LOCATION ); + DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION ); END_TEST; } @@ -2166,13 +2168,13 @@ int UtcDaliActorGetCurrentOpacity(void) TestApplication application; Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetCurrentOpacity() != 0.5f); + DALI_TEST_CHECK(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) != 0.5f); - actor.SetOpacity(0.5f); + actor.SetProperty( DevelActor::Property::OPACITY,0.5f); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(actor.GetCurrentOpacity() == 0.5f); + DALI_TEST_CHECK(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) == 0.5f); END_TEST; } @@ -2181,11 +2183,11 @@ int UtcDaliActorSetSensitive(void) TestApplication application; Actor actor = Actor::New(); - bool sensitive = !actor.IsSensitive(); + bool sensitive = !actor.GetProperty< bool >( Actor::Property::SENSITIVE ); - actor.SetSensitive(sensitive); + actor.SetProperty( Actor::Property::SENSITIVE,sensitive); - DALI_TEST_CHECK(sensitive == actor.IsSensitive()); + DALI_TEST_CHECK(sensitive == actor.GetProperty< bool >( Actor::Property::SENSITIVE )); END_TEST; } @@ -2193,9 +2195,9 @@ int UtcDaliActorIsSensitive(void) { TestApplication application; Actor actor = Actor::New(); - actor.SetSensitive(false); + actor.SetProperty( Actor::Property::SENSITIVE,false); - DALI_TEST_CHECK(false == actor.IsSensitive()); + DALI_TEST_CHECK(false == actor.GetProperty< bool >( Actor::Property::SENSITIVE )); END_TEST; } @@ -2205,35 +2207,42 @@ int UtcDaliActorSetColor(void) Actor actor = Actor::New(); Vector4 color(1.0f, 1.0f, 1.0f, 0.5f); - DALI_TEST_CHECK(color != actor.GetCurrentColor()); + DALI_TEST_CHECK(color != actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); - actor.SetColor(color); + actor.SetProperty( Actor::Property::COLOR,color); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(color == actor.GetCurrentColor()); + DALI_TEST_CHECK(color == actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); - actor.SetColor( actor.GetCurrentColor() + Vector4( -0.4f, -0.5f, -0.6f, -0.4f ) ); + actor.SetProperty( Actor::Property::COLOR, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ) + Vector4( -0.4f, -0.5f, -0.6f, -0.4f ) ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( Vector4( 0.6f, 0.5f, 0.4f, 0.1f ), actor.GetCurrentColor(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector4( 0.6f, 0.5f, 0.4f, 0.1f ), actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); Stage::GetCurrent().Add( actor ); - actor.SetColor( color ); + actor.SetProperty( Actor::Property::COLOR, color ); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( color, actor.GetCurrentColor(), TEST_LOCATION ); + DALI_TEST_EQUALS( color, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); - actor.SetColor( actor.GetCurrentColor() + Vector4( 1.1f, 1.1f, 1.1f, 1.1f ) ); + actor.SetProperty( Actor::Property::COLOR, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ) + Vector4( 1.1f, 1.1f, 1.1f, 1.1f ) ); // flush the queue and render once application.SendNotification(); application.Render(); // Actor color is not clamped - DALI_TEST_EQUALS( Vector4( 2.1f, 2.1f, 2.1f, 1.6f ), actor.GetCurrentColor(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector4( 2.1f, 2.1f, 2.1f, 1.6f ), actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); // world color is clamped - DALI_TEST_EQUALS( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ), actor.GetCurrentWorldColor(), TEST_LOCATION ); + DALI_TEST_EQUALS( Vector4( 1.0f, 1.0f, 1.0f, 1.0f ), actor.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), TEST_LOCATION ); + + actor.SetProperty( Actor::Property::COLOR, color ); + DALI_TEST_EQUALS( color, actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); + + Vector3 newColor( 1.0f, 0.0f, 0.0f ); + actor.SetProperty( Actor::Property::COLOR, newColor ); + DALI_TEST_EQUALS( Vector4( newColor.r, newColor.g, newColor.b, 1.0f ), actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION ); Stage::GetCurrent().Remove( actor ); END_TEST; @@ -2246,7 +2255,7 @@ int UtcDaliActorSetColorIndividual(void) Actor actor = Actor::New(); Vector4 vector(0.7f, 0.8f, 0.9f, 0.6f); - DALI_TEST_CHECK(vector != actor.GetCurrentColor()); + DALI_TEST_CHECK(vector != actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); actor.SetProperty( Actor::Property::COLOR_RED, vector.r ); DALI_TEST_EQUALS( vector.r, actor.GetProperty< float >( Actor::Property::COLOR_RED ), TEST_LOCATION ); @@ -2255,7 +2264,7 @@ int UtcDaliActorSetColorIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.r, actor.GetCurrentColor().r, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.r, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).r, TEST_LOCATION ); DALI_TEST_EQUALS( vector.r, actor.GetProperty< float >( Actor::Property::COLOR_RED ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.r, actor.GetCurrentProperty< float >( Actor::Property::COLOR_RED ), TEST_LOCATION ); @@ -2266,7 +2275,7 @@ int UtcDaliActorSetColorIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.g, actor.GetCurrentColor().g, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.g, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).g, TEST_LOCATION ); DALI_TEST_EQUALS( vector.g, actor.GetProperty< float >( Actor::Property::COLOR_GREEN ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.g, actor.GetCurrentProperty< float >( Actor::Property::COLOR_GREEN ), TEST_LOCATION ); @@ -2277,7 +2286,7 @@ int UtcDaliActorSetColorIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.b, actor.GetCurrentColor().b, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.b, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).b, TEST_LOCATION ); DALI_TEST_EQUALS( vector.b, actor.GetProperty< float >( Actor::Property::COLOR_BLUE ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.b, actor.GetCurrentProperty< float >( Actor::Property::COLOR_BLUE ), TEST_LOCATION ); @@ -2289,7 +2298,7 @@ int UtcDaliActorSetColorIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( vector.a, actor.GetCurrentColor().a, TEST_LOCATION ); + DALI_TEST_EQUALS( vector.a, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, TEST_LOCATION ); DALI_TEST_EQUALS( vector.a, actor.GetProperty< float >( Actor::Property::COLOR_ALPHA ), TEST_LOCATION ); DALI_TEST_EQUALS( vector.a, actor.GetCurrentProperty< float >( Actor::Property::COLOR_ALPHA ), TEST_LOCATION ); @@ -2303,7 +2312,7 @@ int UtcDaliActorSetColorIndividual(void) application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( 0.2f, actor.GetCurrentColor().a, TEST_LOCATION ); + DALI_TEST_EQUALS( 0.2f, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, TEST_LOCATION ); END_TEST; } @@ -2315,11 +2324,11 @@ int UtcDaliActorGetCurrentColor(void) Actor actor = Actor::New(); Vector4 color(1.0f, 1.0f, 1.0f, 0.5f); - actor.SetColor(color); + actor.SetProperty( Actor::Property::COLOR,color); // flush the queue and render once application.SendNotification(); application.Render(); - DALI_TEST_CHECK(color == actor.GetCurrentColor()); + DALI_TEST_CHECK(color == actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR )); END_TEST; } @@ -2330,55 +2339,55 @@ int UtcDaliActorGetCurrentWorldColor(void) Actor parent = Actor::New(); Vector4 parentColor( 1.0f, 0.5f, 0.0f, 0.8f ); - parent.SetColor( parentColor ); + parent.SetProperty( Actor::Property::COLOR, parentColor ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); Vector4 childColor( 0.5f, 0.6f, 0.5f, 1.0f ); - child.SetColor( childColor ); + child.SetProperty( Actor::Property::COLOR, childColor ); parent.Add( child ); - DALI_TEST_EQUALS( parent.GetCurrentColor(), Color::WHITE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentColor(), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION ); // verify the default color mode - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, child.GetColorMode(), TEST_LOCATION ); + DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, child.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); // The actors should not have a world color yet - DALI_TEST_EQUALS( parent.GetCurrentWorldColor(), Color::WHITE, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldColor(), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Color::WHITE, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Color::WHITE, TEST_LOCATION ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( parent.GetCurrentColor(), parentColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentColor(), childColor, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), parentColor, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), childColor, TEST_LOCATION ); // The actors should have a world color now - DALI_TEST_EQUALS( parent.GetCurrentWorldColor(), parentColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldColor(), Vector4( childColor.r, childColor.g, childColor.b, childColor.a * parentColor.a), TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), parentColor, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Vector4( childColor.r, childColor.g, childColor.b, childColor.a * parentColor.a), TEST_LOCATION ); // use own color - child.SetColorMode( USE_OWN_COLOR ); + child.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.GetCurrentWorldColor(), childColor, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), childColor, TEST_LOCATION ); // use parent color - child.SetColorMode( USE_PARENT_COLOR ); + child.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); application.SendNotification(); application.Render(0); - DALI_TEST_EQUALS( child.GetCurrentColor(), childColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldColor(), parentColor, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), childColor, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), parentColor, TEST_LOCATION ); // use parent alpha - child.SetColorMode( USE_OWN_MULTIPLY_PARENT_ALPHA ); + child.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); application.SendNotification(); application.Render(0); Vector4 expectedColor( childColor ); expectedColor.a *= parentColor.a; - DALI_TEST_EQUALS( child.GetCurrentColor(), childColor, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldColor(), expectedColor, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), childColor, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), expectedColor, TEST_LOCATION ); END_TEST; } @@ -2390,17 +2399,17 @@ int UtcDaliActorSetColorMode(void) Actor child = Actor::New(); actor.Add( child ); - actor.SetColorMode( USE_OWN_COLOR ); - DALI_TEST_EQUALS( USE_OWN_COLOR, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); + DALI_TEST_EQUALS( USE_OWN_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); - actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR ); - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_COLOR, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR ); + DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); - actor.SetColorMode( USE_PARENT_COLOR ); - DALI_TEST_EQUALS( USE_PARENT_COLOR, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); + DALI_TEST_EQUALS( USE_PARENT_COLOR, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); - actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_ALPHA ); - DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, actor.GetColorMode(), TEST_LOCATION ); + actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); + DALI_TEST_EQUALS( USE_OWN_MULTIPLY_PARENT_ALPHA, actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), TEST_LOCATION ); END_TEST; } @@ -2408,9 +2417,9 @@ int UtcDaliActorScreenToLocal(void) { TestApplication application; Actor actor = Actor::New(); - actor.SetAnchorPoint(AnchorPoint::TOP_LEFT); - actor.SetSize(100.0f, 100.0f); - actor.SetPosition(10.0f, 10.0f); + actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + actor.SetProperty( Actor::Property::POSITION, Vector2(10.0f, 10.0f)); Stage::GetCurrent().Add(actor); // flush the queue and render once @@ -2436,11 +2445,11 @@ int UtcDaliActorSetLeaveRequired(void) Actor actor = Actor::New(); - actor.SetLeaveRequired(false); - DALI_TEST_CHECK(actor.GetLeaveRequired() == false); + actor.SetProperty( Actor::Property::LEAVE_REQUIRED,false); + DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ) == false); - actor.SetLeaveRequired(true); - DALI_TEST_CHECK(actor.GetLeaveRequired() == true); + actor.SetProperty( Actor::Property::LEAVE_REQUIRED,true); + DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ) == true); END_TEST; } @@ -2450,7 +2459,7 @@ int UtcDaliActorGetLeaveRequired(void) Actor actor = Actor::New(); - DALI_TEST_CHECK(actor.GetLeaveRequired() == false); + DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ) == false); END_TEST; } @@ -2540,7 +2549,7 @@ int UtcDaliActorRemoveConstraintTag(void) result2 = 0; actor.RemoveConstraints(constraint1Tag); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetColor( Color::WHITE ); + actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); // flush the queue and render once application.SendNotification(); application.Render(); @@ -2553,7 +2562,7 @@ int UtcDaliActorRemoveConstraintTag(void) result2 = 0; constraint1.Apply(); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetColor( Color::WHITE ); + actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); // flush the queue and render once application.SendNotification(); application.Render(); @@ -2566,7 +2575,7 @@ int UtcDaliActorRemoveConstraintTag(void) result2 = 0; actor.RemoveConstraints(constraint2Tag); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetColor( Color::WHITE ); + actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); // flush the queue and render once application.SendNotification(); application.Render(); @@ -2579,7 +2588,7 @@ int UtcDaliActorRemoveConstraintTag(void) result2 = 0; actor.RemoveConstraints(constraint1Tag); // make color property dirty, which will trigger constraints to be reapplied. - actor.SetColor( Color::WHITE ); + actor.SetProperty( Actor::Property::COLOR, Color::WHITE ); // flush the queue and render once application.SendNotification(); application.Render(); @@ -2660,7 +2669,7 @@ int UtcDaliActorOnOffStageSignal(void) gActorNamesOnOffStage.clear(); Actor parent = Actor::New(); - parent.SetName( "parent" ); + parent.SetProperty( Actor::Property::NAME, "parent" ); parent.OnStageSignal().Connect( OnStageCallback ); parent.OffStageSignal().Connect( OffStageCallback ); // sanity check @@ -2680,7 +2689,7 @@ int UtcDaliActorOnOffStageSignal(void) gActorNamesOnOffStage.clear(); Actor child = Actor::New(); - child.SetName( "child" ); + child.SetProperty( Actor::Property::NAME, "child" ); child.OnStageSignal().Connect( OnStageCallback ); child.OffStageSignal().Connect( OffStageCallback ); parent.Add( child ); // add child @@ -2743,11 +2752,11 @@ int UtcDaliActorFindChildByName(void) TestApplication application; Actor parent = Actor::New(); - parent.SetName( "parent" ); + parent.SetProperty( Actor::Property::NAME, "parent" ); Actor first = Actor::New(); - first .SetName( "first" ); + first .SetProperty( Actor::Property::NAME, "first" ); Actor second = Actor::New(); - second.SetName( "second" ); + second.SetProperty( Actor::Property::NAME, "second" ); parent.Add(first); first.Add(second); @@ -2824,8 +2833,8 @@ int UtcDaliActorHitTest(void) // get the root layer Actor actor = Actor::New(); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Stage::GetCurrent().Add( actor ); @@ -2834,8 +2843,8 @@ int UtcDaliActorHitTest(void) unsigned int index = 0; while( NULL != hitTestData[index] ) { - actor.SetSize( 1.f, 1.f ); - actor.SetScale( hitTestData[index]->mScale.x, hitTestData[index]->mScale.y, hitTestData[index]->mScale.z ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 1.f, 1.f ) ); + actor.SetProperty( Actor::Property::SCALE, Vector3( hitTestData[index]->mScale.x, hitTestData[index]->mScale.y, hitTestData[index]->mScale.z ) ); // flush the queue and render once application.SendNotification(); @@ -2884,19 +2893,19 @@ int UtcDaliActorSetDrawMode(void) app.SendNotification(); app.Render(1); - DALI_TEST_CHECK( DrawMode::NORMAL == a.GetDrawMode() ); // Ensure overlay is off by default + DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Ensure overlay is off by default - a.SetDrawMode( DrawMode::OVERLAY_2D ); + a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); app.SendNotification(); app.Render(1); - DALI_TEST_CHECK( DrawMode::OVERLAY_2D == a.GetDrawMode() ); // Check Actor is overlay + DALI_TEST_CHECK( DrawMode::OVERLAY_2D == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is overlay - a.SetDrawMode( DrawMode::NORMAL ); + a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::NORMAL ); app.SendNotification(); app.Render(1); - DALI_TEST_CHECK( DrawMode::NORMAL == a.GetDrawMode() ); // Check Actor is normal + DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is normal END_TEST; } @@ -2954,7 +2963,7 @@ int UtcDaliActorSetDrawModeOverlayRender(void) // b (9) // c (10) // a (8) - a.SetDrawMode( DrawMode::OVERLAY_2D ); + a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); app.GetGlAbstraction().ClearBoundTextures(); app.SendNotification(); @@ -2977,26 +2986,26 @@ int UtcDaliActorGetCurrentWorldMatrix(void) tet_infoline(" UtcDaliActorGetCurrentWorldMatrix"); Actor parent = Actor::New(); - parent.SetParentOrigin(ParentOrigin::CENTER); - parent.SetAnchorPoint(AnchorPoint::CENTER); + parent.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); Vector3 parentPosition( 10.0f, 20.0f, 30.0f); Radian rotationAngle(Degree(85.0f)); Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetPosition( parentPosition ); - parent.SetOrientation( parentRotation ); - parent.SetScale( parentScale ); + parent.SetProperty( Actor::Property::POSITION, parentPosition ); + parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); + parent.SetProperty( Actor::Property::SCALE, parentScale ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); - child.SetParentOrigin(ParentOrigin::CENTER); + child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); Vector3 childPosition( 0.0f, 0.0f, 100.0f ); Radian childRotationAngle(Degree(23.0f)); Quaternion childRotation( childRotationAngle, Vector3::YAXIS ); Vector3 childScale( 2.0f, 2.0f, 2.0f ); - child.SetPosition( childPosition ); - child.SetOrientation( childRotation ); - child.SetScale( childScale ); + child.SetProperty( Actor::Property::POSITION, childPosition ); + child.SetProperty( Actor::Property::ORIENTATION, childRotation ); + child.SetProperty( Actor::Property::SCALE, childScale ); parent.Add( child ); app.SendNotification(); @@ -3014,8 +3023,8 @@ int UtcDaliActorGetCurrentWorldMatrix(void) Matrix childWorldMatrix(false); Matrix::Multiply( childWorldMatrix, childMatrix, parentMatrix); - DALI_TEST_EQUALS( parent.GetCurrentWorldMatrix(), parentMatrix, 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentWorldMatrix(), childWorldMatrix, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Matrix >( Actor::Property::WORLD_MATRIX ), parentMatrix, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Matrix >( Actor::Property::WORLD_MATRIX ), childWorldMatrix, 0.001, TEST_LOCATION ); END_TEST; } @@ -3027,19 +3036,19 @@ int UtcDaliActorConstrainedToWorldMatrix(void) tet_infoline(" UtcDaliActorConstrainedToWorldMatrix"); Actor parent = Actor::New(); - parent.SetParentOrigin(ParentOrigin::CENTER); - parent.SetAnchorPoint(AnchorPoint::CENTER); + parent.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); Vector3 parentPosition( 10.0f, 20.0f, 30.0f); Radian rotationAngle(Degree(85.0f)); Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetPosition( parentPosition ); - parent.SetOrientation( parentRotation ); - parent.SetScale( parentScale ); + parent.SetProperty( Actor::Property::POSITION, parentPosition ); + parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); + parent.SetProperty( Actor::Property::SCALE, parentScale ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); - child.SetParentOrigin(ParentOrigin::CENTER); + child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); Constraint posConstraint = Constraint::New( child, Actor::Property::POSITION, PositionComponentConstraint() ); posConstraint.AddSource( Source( parent, Actor::Property::WORLD_MATRIX ) ); posConstraint.Apply(); @@ -3054,8 +3063,8 @@ int UtcDaliActorConstrainedToWorldMatrix(void) Matrix parentMatrix(false); parentMatrix.SetTransformComponents(parentScale, parentRotation, parentPosition); - DALI_TEST_EQUALS( parent.GetCurrentWorldMatrix(), parentMatrix, 0.001, TEST_LOCATION ); - DALI_TEST_EQUALS( child.GetCurrentPosition(), parent.GetCurrentPosition(), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( parent.GetCurrentProperty< Matrix >( Actor::Property::WORLD_MATRIX ), parentMatrix, 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), parent.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), 0.001, TEST_LOCATION ); END_TEST; } @@ -3065,19 +3074,19 @@ int UtcDaliActorConstrainedToOrientation(void) tet_infoline(" UtcDaliActorConstrainedToOrientation"); Actor parent = Actor::New(); - parent.SetParentOrigin(ParentOrigin::CENTER); - parent.SetAnchorPoint(AnchorPoint::CENTER); + parent.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); + parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER); Vector3 parentPosition( 10.0f, 20.0f, 30.0f); Radian rotationAngle(Degree(85.0f)); Quaternion parentRotation(rotationAngle, Vector3::ZAXIS); Vector3 parentScale( 1.0f, 2.0f, 3.0f ); - parent.SetPosition( parentPosition ); - parent.SetOrientation( parentRotation ); - parent.SetScale( parentScale ); + parent.SetProperty( Actor::Property::POSITION, parentPosition ); + parent.SetProperty( Actor::Property::ORIENTATION, parentRotation ); + parent.SetProperty( Actor::Property::SCALE, parentScale ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); - child.SetParentOrigin(ParentOrigin::CENTER); + child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER); Constraint posConstraint = Constraint::New( child, Actor::Property::ORIENTATION, OrientationComponentConstraint() ); posConstraint.AddSource( Source( parent, Actor::Property::ORIENTATION ) ); posConstraint.Apply(); @@ -3089,7 +3098,7 @@ int UtcDaliActorConstrainedToOrientation(void) app.Render(); app.SendNotification(); - DALI_TEST_EQUALS( child.GetCurrentOrientation(), parent.GetCurrentOrientation(), 0.001, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), parent.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION ); END_TEST; } @@ -3099,7 +3108,7 @@ int UtcDaliActorConstrainedToOpacity(void) tet_infoline(" UtcDaliActorConstrainedToOpacity"); Actor parent = Actor::New(); - parent.SetOpacity( 0.7f ); + parent.SetProperty( DevelActor::Property::OPACITY, 0.7f ); Stage::GetCurrent().Add( parent ); Actor child = Actor::New(); @@ -3114,16 +3123,16 @@ int UtcDaliActorConstrainedToOpacity(void) app.Render(); app.SendNotification(); - DALI_TEST_EQUALS( child.GetCurrentOpacity(), parent.GetCurrentOpacity(), 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), parent.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.001f, TEST_LOCATION ); - parent.SetOpacity( 0.3f ); + parent.SetProperty( DevelActor::Property::OPACITY, 0.3f ); app.SendNotification(); app.Render(0); app.Render(); app.SendNotification(); - DALI_TEST_EQUALS( child.GetCurrentOpacity(), parent.GetCurrentOpacity(), 0.001f, TEST_LOCATION ); + DALI_TEST_EQUALS( child.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), parent.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.001f, TEST_LOCATION ); END_TEST; } @@ -3205,8 +3214,8 @@ int UtcDaliActorSetGetOverlay(void) tet_infoline(" UtcDaliActorSetGetOverlay"); Actor parent = Actor::New(); - parent.SetDrawMode(DrawMode::OVERLAY_2D ); - DALI_TEST_CHECK( parent.GetDrawMode() == DrawMode::OVERLAY_2D ); + parent.SetProperty( Actor::Property::DRAW_MODE,DrawMode::OVERLAY_2D ); + DALI_TEST_CHECK( parent.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) == DrawMode::OVERLAY_2D ); END_TEST; } @@ -3270,12 +3279,12 @@ const PropertyStringIndex PROPERTY_TABLE[] = { "leaveRequired", Actor::Property::LEAVE_REQUIRED, Property::BOOLEAN }, { "inheritOrientation", Actor::Property::INHERIT_ORIENTATION, Property::BOOLEAN }, { "inheritScale", Actor::Property::INHERIT_SCALE, Property::BOOLEAN }, - { "colorMode", Actor::Property::COLOR_MODE, Property::STRING }, - { "drawMode", Actor::Property::DRAW_MODE, Property::STRING }, + { "colorMode", Actor::Property::COLOR_MODE, Property::INTEGER }, + { "drawMode", Actor::Property::DRAW_MODE, Property::INTEGER }, { "sizeModeFactor", Actor::Property::SIZE_MODE_FACTOR, Property::VECTOR3 }, { "widthResizePolicy", Actor::Property::WIDTH_RESIZE_POLICY, Property::STRING }, { "heightResizePolicy", Actor::Property::HEIGHT_RESIZE_POLICY, Property::STRING }, - { "sizeScalePolicy", Actor::Property::SIZE_SCALE_POLICY, Property::STRING }, + { "sizeScalePolicy", Actor::Property::SIZE_SCALE_POLICY, Property::INTEGER }, { "widthForHeight", Actor::Property::WIDTH_FOR_HEIGHT, Property::BOOLEAN }, { "heightForWidth", Actor::Property::HEIGHT_FOR_WIDTH, Property::BOOLEAN }, { "padding", Actor::Property::PADDING, Property::VECTOR4 }, @@ -3351,22 +3360,21 @@ int UtcDaliRelayoutProperties_SizeScalePolicy(void) Actor actor = Actor::New(); // Defaults - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_SCALE_POLICY ).Get< std::string >(), "USE_SIZE_SET", TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetSizeScalePolicy(), SizeScalePolicy::USE_SIZE_SET, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), SizeScalePolicy::USE_SIZE_SET, TEST_LOCATION ); SizeScalePolicy::Type policy = SizeScalePolicy::FILL_WITH_ASPECT_RATIO; - actor.SetSizeScalePolicy( policy ); - DALI_TEST_EQUALS( actor.GetSizeScalePolicy(), policy, TEST_LOCATION ); + actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy, TEST_LOCATION ); // Set - const char* const policy1 = "FIT_WITH_ASPECT_RATIO"; - const char* const policy2 = "FILL_WITH_ASPECT_RATIO"; + const SizeScalePolicy::Type policy1 = SizeScalePolicy::FIT_WITH_ASPECT_RATIO; + const SizeScalePolicy::Type policy2 = SizeScalePolicy::FILL_WITH_ASPECT_RATIO; actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy1 ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_SCALE_POLICY ).Get< std::string >(), policy1, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy1, TEST_LOCATION ); actor.SetProperty( Actor::Property::SIZE_SCALE_POLICY, policy2 ); - DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_SCALE_POLICY ).Get< std::string >(), policy2, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< SizeScalePolicy::Type >( Actor::Property::SIZE_SCALE_POLICY ), policy2, TEST_LOCATION ); END_TEST; } @@ -3379,11 +3387,11 @@ int UtcDaliRelayoutProperties_SizeModeFactor(void) // Defaults DALI_TEST_EQUALS( actor.GetProperty( Actor::Property::SIZE_MODE_FACTOR ).Get< Vector3 >(), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); - DALI_TEST_EQUALS( actor.GetSizeModeFactor(), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ), Vector3( 1.0f, 1.0f, 1.0f ), TEST_LOCATION ); Vector3 sizeMode( 1.0f, 2.0f, 3.0f ); - actor.SetSizeModeFactor( sizeMode ); - DALI_TEST_EQUALS( actor.GetSizeModeFactor(), sizeMode, TEST_LOCATION ); + actor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, sizeMode ); + DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::SIZE_MODE_FACTOR ), sizeMode, TEST_LOCATION ); // Set Vector3 sizeMode1( 2.0f, 3.0f, 4.0f ); @@ -3494,7 +3502,7 @@ int UtcDaliActorGetRelayoutSize(void) DALI_TEST_EQUALS( actor.GetRelayoutSize( Dimension::WIDTH ), 0.0f, TEST_LOCATION ); actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::WIDTH ); - actor.SetSize( Vector2( 1.0f, 0.0f ) ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 0.0f ) ); // Flush the queue and render once app.SendNotification(); @@ -3512,7 +3520,7 @@ int UtcDaliActorSetPadding(void) Actor actor = Actor::New(); Padding padding; - actor.GetPadding( padding ); + padding = actor.GetProperty( Actor::Property::PADDING ); DALI_TEST_EQUALS( padding.left, 0.0f, TEST_LOCATION ); DALI_TEST_EQUALS( padding.right, 0.0f, TEST_LOCATION ); @@ -3520,9 +3528,9 @@ int UtcDaliActorSetPadding(void) DALI_TEST_EQUALS( padding.top, 0.0f, TEST_LOCATION ); Padding padding2( 1.0f, 2.0f, 3.0f, 4.0f ); - actor.SetPadding( padding2 ); + actor.SetProperty( Actor::Property::PADDING, padding2 ); - actor.GetPadding( padding ); + padding = actor.GetProperty( Actor::Property::PADDING ); DALI_TEST_EQUALS( padding.left, padding2.left, TEST_LOCATION ); DALI_TEST_EQUALS( padding.right, padding2.right, TEST_LOCATION ); @@ -3538,15 +3546,15 @@ int UtcDaliActorSetMinimumSize(void) Actor actor = Actor::New(); - Vector2 size = actor.GetMinimumSize(); + Vector2 size = actor.GetProperty< Vector2 >( Actor::Property::MINIMUM_SIZE ); DALI_TEST_EQUALS( size.width, 0.0f, TEST_LOCATION ); DALI_TEST_EQUALS( size.height, 0.0f, TEST_LOCATION ); Vector2 size2( 1.0f, 2.0f ); - actor.SetMinimumSize( size2 ); + actor.SetProperty( Actor::Property::MINIMUM_SIZE, size2 ); - size = actor.GetMinimumSize(); + size = actor.GetProperty< Vector2 >( Actor::Property::MINIMUM_SIZE ); DALI_TEST_EQUALS( size.width, size2.width, TEST_LOCATION ); DALI_TEST_EQUALS( size.height, size2.height, TEST_LOCATION ); @@ -3560,15 +3568,15 @@ int UtcDaliActorSetMaximumSize(void) Actor actor = Actor::New(); - Vector2 size = actor.GetMaximumSize(); + Vector2 size = actor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ); DALI_TEST_EQUALS( size.width, FLT_MAX, TEST_LOCATION ); DALI_TEST_EQUALS( size.height, FLT_MAX, TEST_LOCATION ); Vector2 size2( 1.0f, 2.0f ); - actor.SetMaximumSize( size2 ); + actor.SetProperty( Actor::Property::MAXIMUM_SIZE, size2 ); - size = actor.GetMaximumSize(); + size = actor.GetProperty< Vector2 >( Actor::Property::MAXIMUM_SIZE ); DALI_TEST_EQUALS( size.width, size2.width, TEST_LOCATION ); DALI_TEST_EQUALS( size.height, size2.height, TEST_LOCATION ); @@ -3587,7 +3595,7 @@ int UtcDaliActorOnRelayoutSignal(void) gActorNamesRelayout.clear(); Actor actor = Actor::New(); - actor.SetName( "actor" ); + actor.SetProperty( Actor::Property::NAME, "actor" ); actor.OnRelayoutSignal().Connect( OnRelayoutCallback ); // Sanity check @@ -3597,7 +3605,7 @@ int UtcDaliActorOnRelayoutSignal(void) Stage::GetCurrent().Add( actor ); actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - actor.SetSize( Vector2( 1.0f, 2.0 ) ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 2.0 ) ); // Flush the queue and render once application.SendNotification(); @@ -3691,35 +3699,35 @@ int UtcDaliActorAnchorPointPropertyAsString(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::ANCHOR_POINT, "TOP_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::TOP_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::TOP_LEFT, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "TOP_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::TOP_CENTER, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::TOP_CENTER, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "TOP_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::TOP_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::TOP_RIGHT, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "CENTER_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::CENTER_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::CENTER_LEFT, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::CENTER, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::CENTER, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "CENTER_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::CENTER_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::CENTER_RIGHT, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "BOTTOM_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "BOTTOM_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION ); actor.SetProperty( Actor::Property::ANCHOR_POINT, "BOTTOM_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); // Invalid should not change anything actor.SetProperty( Actor::Property::ANCHOR_POINT, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetCurrentAnchorPoint(), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); END_TEST; } @@ -3731,35 +3739,35 @@ int UtcDaliActorParentOriginPropertyAsString(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "TOP_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::TOP_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_LEFT, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "TOP_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::TOP_CENTER, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_CENTER, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "TOP_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::TOP_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_RIGHT, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "CENTER_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::CENTER_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::CENTER_LEFT, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::CENTER, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::CENTER, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "CENTER_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::CENTER_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::CENTER_RIGHT, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "BOTTOM_LEFT" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_LEFT, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "BOTTOM_CENTER" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_CENTER, TEST_LOCATION ); actor.SetProperty( Actor::Property::PARENT_ORIGIN, "BOTTOM_RIGHT" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); // Invalid should not change anything actor.SetProperty( Actor::Property::PARENT_ORIGIN, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetCurrentParentOrigin(), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::BOTTOM_RIGHT, TEST_LOCATION ); END_TEST; } @@ -3771,20 +3779,20 @@ int UtcDaliActorColorModePropertyAsString(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_COLOR" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_PARENT_COLOR" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_COLOR" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, "USE_OWN_MULTIPLY_PARENT_ALPHA" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); // Invalid should not change anything actor.SetProperty( Actor::Property::COLOR_MODE, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); END_TEST; } @@ -3796,14 +3804,14 @@ int UtcDaliActorDrawModePropertyAsString(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::DRAW_MODE, "NORMAL" ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::NORMAL, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::NORMAL, TEST_LOCATION ); actor.SetProperty( Actor::Property::DRAW_MODE, "OVERLAY_2D" ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); // Invalid should not change anything actor.SetProperty( Actor::Property::DRAW_MODE, "INVALID_ARG" ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); END_TEST; } @@ -3815,16 +3823,16 @@ int UtcDaliActorColorModePropertyAsEnum(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_COLOR ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, USE_PARENT_COLOR ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_COLOR ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_COLOR, TEST_LOCATION ); actor.SetProperty( Actor::Property::COLOR_MODE, USE_OWN_MULTIPLY_PARENT_ALPHA ); - DALI_TEST_EQUALS( actor.GetColorMode(), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_OWN_MULTIPLY_PARENT_ALPHA, TEST_LOCATION ); END_TEST; } @@ -3836,10 +3844,10 @@ int UtcDaliActorDrawModePropertyAsEnum(void) Actor actor = Actor::New(); actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::NORMAL ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::NORMAL, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::NORMAL, TEST_LOCATION ); actor.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D ); - DALI_TEST_EQUALS( actor.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION ); END_TEST; } @@ -4028,9 +4036,9 @@ Actor CreateActorWithContent( uint32_t width, uint32_t height) // Setup dimensions and position so actor is not skipped by culling. actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - actor.SetSize( width, height ); - actor.SetParentOrigin( ParentOrigin::CENTER ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::SIZE, Vector2( width, height ) ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); return actor; } @@ -4336,16 +4344,16 @@ int UtcDaliActorPropertyClippingActorDrawOrder(void) // Setup dimensions and position so actor is not skipped by culling. actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); - actor.SetSize( 16.0f, 16.0f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 16.0f, 16.0f ) ); if( i == 0 ) { - actor.SetParentOrigin( ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); } else { float b = i > 2 ? 1.0f : -1.0f; - actor.SetParentOrigin( Vector3( 0.5 + ( 0.2f * b ), 0.8f, 0.8f ) ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5 + ( 0.2f * b ), 0.8f, 0.8f ) ); } actors[i] = actor; @@ -4419,8 +4427,8 @@ int UtcDaliActorPropertyScissorClippingActor(void) Actor clippingActorA = CreateActorWithContent16x16(); // Note: Scissor coords are have flipped Y values compared with DALi's coordinate system. // We choose BOTTOM_LEFT to give us x=0, y=0 starting coordinates for the first test. - clippingActorA.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); - clippingActorA.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); + clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); + clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); Stage::GetCurrent().Add( clippingActorA ); @@ -4438,8 +4446,8 @@ int UtcDaliActorPropertyScissorClippingActor(void) compareParametersString << "0, 0, " << imageSize.x << ", " << imageSize.y; DALI_TEST_CHECK( scissorTrace.FindMethodAndParams( "Scissor", compareParametersString.str() ) ); // Compare with 0, 0, 16, 16 - clippingActorA.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - clippingActorA.SetAnchorPoint( AnchorPoint::TOP_RIGHT ); + clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_RIGHT ); // Gather the call trace. GenerateTrace( application, enabledDisableTrace, scissorTrace ); @@ -4472,16 +4480,16 @@ int UtcDaliActorPropertyScissorClippingActorSiblings(void) Actor clippingActorA = CreateActorWithContent( sizeA.width, sizeA.height ); Actor clippingActorB = CreateActorWithContent( sizeB.width, sizeB.height ); - clippingActorA.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - clippingActorA.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - clippingActorB.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - clippingActorB.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + clippingActorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); clippingActorB.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - clippingActorA.SetPosition( 0.0f, -200.0f, 0.0f ); - clippingActorB.SetPosition( 0.0f, 0.0f, 0.0f ); + clippingActorA.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, -200.0f, 0.0f )); + clippingActorB.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); Stage::GetCurrent().Add( clippingActorA ); Stage::GetCurrent().Add( clippingActorB ); @@ -4541,15 +4549,15 @@ int UtcDaliActorPropertyScissorClippingActorNested01(void) Actor clippingActorA = CreateActorWithContent16x16(); // Note: Scissor coords are have flipped Y values compared with DALi's coordinate system. // We choose BOTTOM_LEFT to give us x=0, y=0 starting coordinates for the first test. - clippingActorA.SetParentOrigin( ParentOrigin::CENTER ); - clippingActorA.SetAnchorPoint( AnchorPoint::CENTER ); + clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); Stage::GetCurrent().Add( clippingActorA ); // Create a child clipping actor. Actor clippingActorB = CreateActorWithContent16x16(); - clippingActorB.SetParentOrigin( ParentOrigin::CENTER ); - clippingActorB.SetAnchorPoint( AnchorPoint::CENTER ); + clippingActorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + clippingActorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); clippingActorB.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); clippingActorA.Add( clippingActorB ); @@ -4563,7 +4571,7 @@ int UtcDaliActorPropertyScissorClippingActorNested01(void) { // Position the child clipping actor so it intersects with the 1st clipping actor. This changes each loop. const Vector2 position = ( imageSize / 2.0f ) * positionModifiers[test]; - clippingActorB.SetPosition( position.x, position.y ); + clippingActorB.SetProperty( Actor::Property::POSITION, Vector2( position.x, position.y )); // Gather the call trace. GenerateTrace( application, enabledDisableTrace, scissorTrace ); @@ -4618,30 +4626,30 @@ int UtcDaliActorPropertyScissorClippingActorNested02(void) Actor clippingActorD = CreateActorWithContent( sizeD.width, sizeD.height ); Actor clippingActorE = CreateActorWithContent( sizeE.width, sizeE.height ); - clippingActorA.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - clippingActorA.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - clippingActorB.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - clippingActorB.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + clippingActorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); clippingActorB.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - clippingActorC.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - clippingActorC.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + clippingActorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); clippingActorC.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - clippingActorD.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - clippingActorD.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorD.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + clippingActorD.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); clippingActorD.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX ); - clippingActorE.SetParentOrigin( ParentOrigin::CENTER_LEFT ); - clippingActorE.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + clippingActorE.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER_LEFT ); + clippingActorE.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER_LEFT ); - clippingActorA.SetPosition( 0.0f, -200.0f, 0.0f ); - clippingActorB.SetPosition( 0.0f, 0.0f, 0.0f ); - clippingActorC.SetPosition( 0.0f, 100.0f, 0.0f ); - clippingActorD.SetPosition( 0.0f, 0.0f, 0.0f ); - clippingActorE.SetPosition( 0.0f, 0.0f, 0.0f ); + clippingActorA.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, -200.0f, 0.0f )); + clippingActorB.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); + clippingActorC.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 100.0f, 0.0f )); + clippingActorD.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); + clippingActorE.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f )); Stage::GetCurrent().Add( clippingActorA ); clippingActorA.Add( clippingActorB ); @@ -4739,20 +4747,22 @@ int UtcDaliActorRaiseLower(void) TestApplication application; + Debug::Filter::SetGlobalLogLevel( Debug::Verbose ); + Stage stage( Stage::GetCurrent() ); Actor actorA = Actor::New(); Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -4859,6 +4869,8 @@ int UtcDaliActorRaiseLower(void) ResetTouchCallbacks(); + Debug::Filter::SetGlobalLogLevel( Debug::NoLogging ); + END_TEST; } @@ -4897,14 +4909,14 @@ int UtcDaliActorRaiseToTopLowerToBottom(void) Renderer rendererC = Renderer::New(geometry, shaderC); actorC.AddRenderer(rendererC); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -5109,14 +5121,14 @@ int UtcDaliActorRaiseAbove(void) Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -5241,14 +5253,14 @@ int UtcDaliActorLowerBelow(void) Renderer rendererC = Renderer::New(geometry, shaderC); actorC.AddRenderer(rendererC); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -5260,7 +5272,7 @@ int UtcDaliActorLowerBelow(void) actorC.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); Actor container = Actor::New(); - container.SetParentOrigin( ParentOrigin::CENTER ); + container.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); container.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); stage.Add( container ); @@ -5447,11 +5459,11 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void) parentB.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); parentB.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); - parentA.SetAnchorPoint( AnchorPoint::CENTER ); - parentA.SetParentOrigin( ParentOrigin::CENTER ); + parentA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + parentA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - parentB.SetAnchorPoint( AnchorPoint::CENTER ); - parentB.SetParentOrigin( ParentOrigin::CENTER ); + parentB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + parentB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); stage.Add( parentA ); stage.Add( parentB ); @@ -5466,14 +5478,14 @@ int UtcDaliActorRaiseAboveDifferentParentsN(void) tet_printf( "Actor C added to different parent from A and B \n" ); parentB.Add( actorC ); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -5552,14 +5564,14 @@ int UtcDaliActorRaiseLowerWhenUnparentedTargetN(void) Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -5720,14 +5732,14 @@ int UtcDaliActorTestAllAPIwhenActorNotParented(void) Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -5881,14 +5893,14 @@ int UtcDaliActorRaiseAboveActorAndTargetTheSameN(void) Actor actorB = Actor::New(); Actor actorC = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorB.SetAnchorPoint( AnchorPoint::CENTER ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( Actor::Property::WIDTH_RESIZE_POLICY, "FILL_TO_PARENT" ); actorA.SetProperty( Actor::Property::HEIGHT_RESIZE_POLICY, "FILL_TO_PARENT" ); @@ -5984,12 +5996,12 @@ int UtcDaliActorGetScreenPosition(void) Stage stage( Stage::GetCurrent() ); Actor actorA = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Vector2 size2( 10.0f, 20.0f ); - actorA.SetSize( size2 ); + actorA.SetProperty( Actor::Property::SIZE, size2 ); - actorA.SetPosition( 0.f, 0.f ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( "UtcDaliActorGetScreenPosition Center Anchor Point and 0,0 position \n" ); @@ -6009,7 +6021,7 @@ int UtcDaliActorGetScreenPosition(void) tet_infoline( "UtcDaliActorGetScreenPosition Top Left Anchor Point and 0,0 position \n" ); - actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); application.SendNotification(); application.Render(); @@ -6025,7 +6037,7 @@ int UtcDaliActorGetScreenPosition(void) tet_infoline( "UtcDaliActorGetScreenPosition Bottom right Anchor Point and 0,0 position \n" ); - actorA.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); application.SendNotification(); application.Render(); @@ -6041,7 +6053,7 @@ int UtcDaliActorGetScreenPosition(void) tet_infoline( "UtcDaliActorGetScreenPosition Bottom right Anchor Point and 30,0 position \n" ); - actorA.SetPosition( 30.0, 0.0 ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 30.0, 0.0 )); application.SendNotification(); application.Render(); @@ -6057,7 +6069,7 @@ int UtcDaliActorGetScreenPosition(void) tet_infoline( "UtcDaliActorGetScreenPosition Bottom right Anchor Point and 30,420 position \n" ); - actorA.SetPosition( 30.0, 420.0 ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 30.0, 420.0 )); application.SendNotification(); application.Render(); @@ -6073,16 +6085,16 @@ int UtcDaliActorGetScreenPosition(void) tet_infoline( "UtcDaliActorGetScreenPosition Scale parent and check child's screen position \n" ); - actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actorA.SetPosition( 30.0, 30.0 ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 30.0, 30.0 )); Actor actorB = Actor::New(); - actorB.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actorB.SetSize( size2 ); - actorB.SetPosition( 10.f, 10.f ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorB.SetProperty( Actor::Property::SIZE, size2 ); + actorB.SetProperty( Actor::Property::POSITION, Vector2( 10.f, 10.f )); actorA.Add( actorB ); - actorA.SetScale( 2.0f ); + actorA.SetProperty( Actor::Property::SCALE, 2.0f ); application.SendNotification(); application.Render(); @@ -6104,12 +6116,12 @@ int UtcDaliActorGetScreenPositionAfterScaling(void) Stage stage( Stage::GetCurrent() ); Actor actorA = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); Vector2 size2( 10.0f, 20.0f ); - actorA.SetSize( size2 ); - actorA.SetScale( 1.5f ); - actorA.SetPosition( 0.f, 0.f ); + actorA.SetProperty( Actor::Property::SIZE, size2 ); + actorA.SetProperty( Actor::Property::SCALE, 1.5f ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( "UtcDaliActorGetScreenPositionAfterScaling TopRight Anchor Point, scale 1.5f and 0,0 position \n" ); @@ -6129,7 +6141,7 @@ int UtcDaliActorGetScreenPositionAfterScaling(void) tet_infoline( "UtcDaliActorGetScreenPositionAfterScaling BOTTOM_RIGHT Anchor Point, scale 1.5f and 0,0 position \n" ); - actorA.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); application.SendNotification(); application.Render(); @@ -6155,11 +6167,11 @@ int UtcDaliActorGetScreenPositionWithDifferentParentOrigin(void) Stage stage( Stage::GetCurrent() ); Actor actorA = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Vector2 size2( 10.0f, 20.0f ); - actorA.SetSize( size2 ); - actorA.SetPosition( 0.f, 0.f ); + actorA.SetProperty( Actor::Property::SIZE, size2 ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( " TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); @@ -6179,8 +6191,8 @@ int UtcDaliActorGetScreenPositionWithDifferentParentOrigin(void) tet_infoline( " BOTTOM_RIGHT Anchor Point, ParentOrigin::TOP_RIGHT and 0,0 position \n" ); - actorA.SetParentOrigin( ParentOrigin::TOP_RIGHT ); - actorA.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_RIGHT ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); application.SendNotification(); application.Render(); @@ -6209,20 +6221,20 @@ int UtcDaliActorGetScreenPositionWithChildActors(void) tet_infoline( "Create Child Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); Actor actorA = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Vector2 size1( 10.0f, 20.0f ); - actorA.SetSize( size1 ); - actorA.SetPosition( 0.f, 0.f ); + actorA.SetProperty( Actor::Property::SIZE, size1 ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( "Create Parent Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); Actor parentActorA = Actor::New(); - parentActorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - parentActorA.SetParentOrigin( ParentOrigin::CENTER ); + parentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + parentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Vector2 size2( 30.0f, 60.0f ); - parentActorA.SetSize( size2 ); - parentActorA.SetPosition( 0.f, 0.f ); + parentActorA.SetProperty( Actor::Property::SIZE, size2 ); + parentActorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( "Add child 1 to Parent 1 and check screen position \n" ); @@ -6245,8 +6257,8 @@ int UtcDaliActorGetScreenPositionWithChildActors(void) tet_infoline( "change parent anchor point and parent origin then check screen position \n" ); - parentActorA.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); - parentActorA.SetParentOrigin( ParentOrigin::TOP_LEFT ); + parentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); + parentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT ); application.SendNotification(); application.Render(); @@ -6274,29 +6286,29 @@ int UtcDaliActorGetScreenPositionWithChildActors02(void) tet_infoline( "Create Child Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); Actor actorA = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Vector2 size1( 10.0f, 20.0f ); - actorA.SetSize( size1 ); - actorA.SetPosition( 0.f, 0.f ); + actorA.SetProperty( Actor::Property::SIZE, size1 ); + actorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( "Create Parent Actor 1 TOP_LEFT Anchor Point, ParentOrigin::CENTER and 0,0 position \n" ); Actor parentActorA = Actor::New(); - parentActorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - parentActorA.SetParentOrigin( ParentOrigin::CENTER ); + parentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + parentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); Vector2 size2( 30.0f, 60.0f ); - parentActorA.SetSize( size2 ); - parentActorA.SetPosition( 0.f, 0.f ); + parentActorA.SetProperty( Actor::Property::SIZE, size2 ); + parentActorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( "Create Grand Parent Actor 1 BOTTOM_LEFT Anchor Point, ParentOrigin::BOTTOM_LEFT and 0,0 position \n" ); Actor grandParentActorA = Actor::New(); - grandParentActorA.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); - grandParentActorA.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); + grandParentActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT ); + grandParentActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT ); Vector2 size3( 60.0f, 120.0f ); - grandParentActorA.SetSize( size3 ); - grandParentActorA.SetPosition( 0.f, 0.f ); + grandParentActorA.SetProperty( Actor::Property::SIZE, size3 ); + grandParentActorA.SetProperty( Actor::Property::POSITION, Vector2( 0.f, 0.f )); tet_infoline( "Add Parent 1 to Grand Parent 1 \n" ); @@ -6333,30 +6345,30 @@ int UtcDaliActorGetScreenPositionPositionUsesAnchorPointFalse(void) tet_infoline( "Create an actor with AnchorPoint::TOP_LEFT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" ); Actor actorA = Actor::New(); - actorA.SetAnchorPoint( AnchorPoint::TOP_LEFT ); - actorA.SetParentOrigin( ParentOrigin::CENTER ); + actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); + actorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorA.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); - actorA.SetSize( 10.0f, 20.0f ); + actorA.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 20.0f ) ); stage.Add( actorA ); tet_infoline( "Create an Actor with AnchorPoint::BOTTOM_RIGHT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" ); Actor actorB = Actor::New(); - actorB.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); - actorB.SetParentOrigin( ParentOrigin::CENTER ); + actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); + actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorB.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); Vector2 actorBSize( 30.0f, 60.0f ); - actorB.SetSize( actorBSize ); + actorB.SetProperty( Actor::Property::SIZE, actorBSize ); stage.Add( actorB ); tet_infoline( "Create an actor with AnchorPoint::CENTER, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" ); Actor actorC = Actor::New(); - actorC.SetAnchorPoint( AnchorPoint::CENTER ); - actorC.SetParentOrigin( ParentOrigin::CENTER ); + actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); actorC.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); Vector2 actorCSize( 60.0f, 120.0f ); - actorC.SetSize( actorCSize ); + actorC.SetProperty( Actor::Property::SIZE, actorCSize ); stage.Add( actorC ); application.SendNotification(); @@ -6372,9 +6384,9 @@ int UtcDaliActorGetScreenPositionPositionUsesAnchorPointFalse(void) tet_infoline( "Add scale to all actors" ); - actorA.SetScale( 2.0f ); - actorB.SetScale( 2.0f ); - actorC.SetScale( 2.0f ); + actorA.SetProperty( Actor::Property::SCALE, 2.0f ); + actorB.SetProperty( Actor::Property::SCALE, 2.0f ); + actorC.SetProperty( Actor::Property::SCALE, 2.0f ); application.SendNotification(); application.Render(); @@ -6392,16 +6404,16 @@ int utcDaliActorPositionUsesAnchorPoint(void) tet_infoline( "Check default behaviour\n" ); Actor actor = Actor::New(); - actor.SetParentOrigin( ParentOrigin::CENTER ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetSize( 100.0f, 100.0f ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); Stage::GetCurrent().Add( actor ); application.SendNotification(); application.Render(); tet_infoline( "Check that the world position is in the center\n" ); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); tet_infoline( "Set the position uses anchor point property to false\n" ); actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); @@ -6410,7 +6422,7 @@ int utcDaliActorPositionUsesAnchorPoint(void) application.Render(); tet_infoline( "Check that the world position has changed appropriately\n" ); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); END_TEST; } @@ -6421,10 +6433,10 @@ int utcDaliActorPositionUsesAnchorPointCheckScale(void) tet_infoline( "Check that the scale is adjusted appropriately when setting the positionUsesAnchorPoint to false\n" ); Actor actor = Actor::New(); - actor.SetParentOrigin( ParentOrigin::CENTER ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetSize( 100.0f, 100.0f ); - actor.SetScale( 2.0f ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + actor.SetProperty( Actor::Property::SCALE, 2.0f ); actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); Stage::GetCurrent().Add( actor ); @@ -6432,19 +6444,19 @@ int utcDaliActorPositionUsesAnchorPointCheckScale(void) application.Render(); tet_infoline( "Check the world position is the same as it would be without a scale\n" ); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly" ); - actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 100.0f, 100.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 100.0f, 100.0f, 0.0f ), TEST_LOCATION ); tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly" ); - actor.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION ); END_TEST; } @@ -6455,10 +6467,10 @@ int utcDaliActorPositionUsesAnchorPointCheckRotation(void) tet_infoline( "Check that the rotation is adjusted appropriately when setting the positionUsesAnchorPoint to false\n" ); Actor actor = Actor::New(); - actor.SetParentOrigin( ParentOrigin::CENTER ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetSize( 100.0f, 100.0f ); - actor.SetOrientation( Degree( 90.0f), Vector3::ZAXIS ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) ); actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); Stage::GetCurrent().Add( actor ); @@ -6466,19 +6478,19 @@ int utcDaliActorPositionUsesAnchorPointCheckRotation(void) application.Render(); tet_infoline( "Check the world position is the same as it would be without a rotation\n" ); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly" ); - actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( -50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( -50.0f, 50.0f, 0.0f ), TEST_LOCATION ); tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly" ); - actor.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 150.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 150.0f, 50.0f, 0.0f ), TEST_LOCATION ); END_TEST; } @@ -6489,11 +6501,11 @@ int utcDaliActorPositionUsesAnchorPointCheckScaleAndRotation(void) tet_infoline( "Check that the scale and rotation is adjusted appropriately when setting the positionUsesAnchorPoint to false\n" ); Actor actor = Actor::New(); - actor.SetParentOrigin( ParentOrigin::CENTER ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetSize( 100.0f, 100.0f ); - actor.SetOrientation( Degree( 90.0f), Vector3::ZAXIS ); - actor.SetScale( 2.0f ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) ); + actor.SetProperty( Actor::Property::SCALE, 2.0f ); actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); Stage::GetCurrent().Add( actor ); @@ -6501,19 +6513,19 @@ int utcDaliActorPositionUsesAnchorPointCheckScaleAndRotation(void) application.Render(); tet_infoline( "Check the world position is the same as it would be without a scale and rotation\n" ); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 50.0f, 50.0f, 0.0f ), TEST_LOCATION ); tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure the world position changes accordingly" ); - actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( -100.0f, 100.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( -100.0f, 100.0f, 0.0f ), TEST_LOCATION ); tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure the world position changes accordingly" ); - actor.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), Vector3( 200.0f, 0.0f, 0.0f ), TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 200.0f, 0.0f, 0.0f ), TEST_LOCATION ); END_TEST; } @@ -6529,11 +6541,11 @@ int utcDaliActorPositionUsesAnchorPointOnlyInheritPosition(void) Vector2 stageSize( Stage::GetCurrent().GetSize() ); Actor actor = Actor::New(); - actor.SetParentOrigin( ParentOrigin::CENTER ); - actor.SetAnchorPoint( AnchorPoint::CENTER ); - actor.SetSize( 100.0f, 100.0f ); - actor.SetInheritScale( false ); - actor.SetInheritOrientation( false ); + actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); + actor.SetProperty( Actor::Property::INHERIT_SCALE, false ); + actor.SetProperty( Actor::Property::INHERIT_ORIENTATION, false ); actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); parent.Add( actor ); @@ -6543,19 +6555,19 @@ int utcDaliActorPositionUsesAnchorPointOnlyInheritPosition(void) const Vector3 expectedWorldPosition( -stageSize.width * 0.5f + 50.0f, -stageSize.height * 0.5f + 50.0f, 0.0f ); tet_infoline( "Check the world position is in the right place\n" ); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), expectedWorldPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), expectedWorldPosition, TEST_LOCATION ); tet_infoline( "Change the Anchor Point to TOP_LEFT and ensure world position hasn't changed" ); - actor.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), expectedWorldPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), expectedWorldPosition, TEST_LOCATION ); tet_infoline( "Change the Anchor Point to BOTTOM_RIGHT and ensure world position hasn't changed" ); - actor.SetAnchorPoint( AnchorPoint::BOTTOM_RIGHT ); + actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT ); application.SendNotification(); application.Render(); - DALI_TEST_EQUALS( actor.GetCurrentWorldPosition(), expectedWorldPosition, TEST_LOCATION ); + DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), expectedWorldPosition, TEST_LOCATION ); END_TEST; } @@ -6570,14 +6582,14 @@ int utcDaliActorVisibilityChangeSignalSelf(void) VisibilityChangedFunctorData data; DevelActor::VisibilityChangedSignal( actor ).Connect( &application, VisibilityChangedFunctor( data ) ); - actor.SetVisible( false ); + actor.SetProperty( Actor::Property::VISIBLE, false ); data.Check( true /* called */, actor, false /* not visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION ); tet_infoline( "Ensure functor is not called if we attempt to change the visibility to what it already is at" ); data.Reset(); - actor.SetVisible( false ); + actor.SetProperty( Actor::Property::VISIBLE, false ); data.Check( false /* not called */, TEST_LOCATION ); tet_infoline( "Change the visibility using properties, ensure called" ); @@ -6615,7 +6627,7 @@ int utcDaliActorVisibilityChangeSignalChildren(void) DevelActor::VisibilityChangedSignal( child ).Connect( &application, VisibilityChangedFunctor( childData ) ); DevelActor::VisibilityChangedSignal( grandChild ).Connect( &application, VisibilityChangedFunctor( grandChildData ) ); - parent.SetVisible( false ); + parent.SetProperty( Actor::Property::VISIBLE, false ); parentData.Check( false /* not called */, TEST_LOCATION ); childData.Check( true /* called */, child, false /* not visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); grandChildData.Check( true /* called */, grandChild, false /* not visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); @@ -6627,7 +6639,7 @@ int utcDaliActorVisibilityChangeSignalChildren(void) DevelActor::VisibilityChangedSignal( parent ).Connect( &application, VisibilityChangedFunctor( parentData ) ); - parent.SetVisible( true ); + parent.SetProperty( Actor::Property::VISIBLE, true ); parentData.Check( true /* called */, parent, true /* visible */, DevelActor::VisibilityChange::SELF, TEST_LOCATION ); childData.Check( true /* called */, child, true /* visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); grandChildData.Check( true /* called */, grandChild, true /* visible */, DevelActor::VisibilityChange::PARENT, TEST_LOCATION ); @@ -6637,7 +6649,7 @@ int utcDaliActorVisibilityChangeSignalChildren(void) childData.Reset(); grandChildData.Reset(); - parent.SetVisible( true ); + parent.SetProperty( Actor::Property::VISIBLE, true ); parentData.Check( false /* not called */, TEST_LOCATION ); childData.Check( false /* not called */, TEST_LOCATION ); grandChildData.Check( false /* not called */, TEST_LOCATION ); @@ -6694,12 +6706,12 @@ int utcDaliActorVisibilityChangeSignalByName(void) bool signalCalled=false; actor.ConnectSignal( &application, "visibilityChanged", VisibilityChangedVoidFunctor(signalCalled) ); DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); - actor.SetVisible( false ); + actor.SetProperty( Actor::Property::VISIBLE, false ); DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION ); tet_infoline( "Ensure functor is not called if we attempt to change the visibility to what it already is at" ); signalCalled = false; - actor.SetVisible( false ); + actor.SetProperty( Actor::Property::VISIBLE, false ); DALI_TEST_EQUALS( signalCalled, false, TEST_LOCATION ); tet_infoline( "Change the visibility using properties, ensure called" ); @@ -7157,7 +7169,7 @@ int utcDaliActorCulled(void) tet_infoline( "Check that the actor is culled if the actor is out of the screen" ); Actor actor = Actor::New(); - actor.SetSize( 10.0f, 10.0f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) ); Geometry geometry = CreateQuadGeometry(); Shader shader = CreateShader(); @@ -7180,7 +7192,7 @@ int utcDaliActorCulled(void) CulledPropertyNotificationFunctor f( propertyNotificationSignal, source ); notification.NotifySignal().Connect( &application, f ) ; - actor.SetPosition( 1000.0f, 1000.0f ); + actor.SetProperty( Actor::Property::POSITION, Vector2( 1000.0f, 1000.0f )); application.SendNotification(); application.Render(); @@ -7204,7 +7216,7 @@ int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void) tet_infoline( "Ensure we clear the screen when the last actor is removed" ); Actor actor = CreateRenderableActor(); - actor.SetSize( 100.0f, 100.0f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); stage.Add( actor ); application.SendNotification(); @@ -7231,7 +7243,7 @@ int utcDaliEnsureRenderWhenMakingLastActorInvisible(void) tet_infoline( "Ensure we clear the screen when the last actor is made invisible" ); Actor actor = CreateRenderableActor(); - actor.SetSize( 100.0f, 100.0f ); + actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) ); stage.Add( actor ); application.SendNotification(); @@ -7240,7 +7252,7 @@ int utcDaliEnsureRenderWhenMakingLastActorInvisible(void) auto& glAbstraction = application.GetGlAbstraction(); const auto clearCountBefore = glAbstraction.GetClearCountCalled(); - actor.SetVisible( false ); + actor.SetProperty( Actor::Property::VISIBLE, false ); application.SendNotification(); application.Render(); @@ -7249,3 +7261,201 @@ int utcDaliEnsureRenderWhenMakingLastActorInvisible(void) END_TEST; } + +int utcDaliActorGetSizeAfterAnimation(void) +{ + TestApplication application; + tet_infoline( "Check the actor size before / after an animation is finished" ); + + Vector3 actorSize( 100.0f, 100.0f, 0.0f ); + + Actor actor = Actor::New(); + actor.SetProperty( Actor::Property::SIZE, actorSize ); + actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS ); + Stage::GetCurrent().Add( actor ); + + // Size should be updated without rendering. + Vector3 size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + // Size and current size should be updated. + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( actorSize.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( actorSize.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( actorSize.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + Vector3 currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( actorSize.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( actorSize.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( actorSize.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + // Set size again + actorSize = Vector3( 200.0f, 200.0f, 0.0f ); + actor.SetProperty( Actor::Property::SIZE, actorSize ); + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + Vector3 targetValue( 10.0f, 20.0f, 0.0f ); + + Animation animation = Animation::New( 1.0f ); + animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetValue ); + animation.Play(); + + // Size should be updated without rendering. + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + application.SendNotification(); + application.Render( 1100 ); // After the animation + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + targetValue.width = 50.0f; + + animation.Clear(); + animation.AnimateTo( Property( actor, Actor::Property::SIZE_WIDTH ), targetValue.width ); + animation.Play(); + + application.SendNotification(); + application.Render( 1100 ); // After the animation + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + targetValue.height = 70.0f; + + animation.Clear(); + animation.AnimateTo( Property( actor, Actor::Property::SIZE_HEIGHT ), targetValue.height ); + animation.Play(); + + application.SendNotification(); + application.Render( 1100 ); // After the animation + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + Vector3 offset( 10.0f, 20.0f, 0.0f ); + + animation.Clear(); + animation.AnimateBy( Property( actor, Actor::Property::SIZE ), offset ); + animation.Play(); + + application.SendNotification(); + application.Render( 1100 ); // After the animation + + targetValue += offset; + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + offset.width = 20.0f; + + animation.Clear(); + animation.AnimateBy( Property( actor, Actor::Property::SIZE_WIDTH ), offset.width ); + animation.Play(); + + application.SendNotification(); + application.Render( 1100 ); // After the animation + + targetValue.width += offset.width; + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + offset.height = 10.0f; + + animation.Clear(); + animation.AnimateBy( Property( actor, Actor::Property::SIZE_HEIGHT ), offset.height ); + animation.Play(); + + application.SendNotification(); + application.Render( 1100 ); // After the animation + + targetValue.height += offset.height; + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION ); + DALI_TEST_EQUALS( targetValue.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION ); + + // Set size again + actorSize = Vector3( 300.0f, 300.0f, 0.0f ); + + actor.SetProperty( Actor::Property::SIZE, actorSize ); + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + application.SendNotification(); + application.Render(); + + size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + currentSize = actor.GetCurrentProperty( Actor::Property::SIZE ).Get< Vector3 >(); + DALI_TEST_EQUALS( currentSize, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION ); + + END_TEST; +}