END_TEST;
}
-// SetSize(float width, float height)
int UtcDaliActorSetSize01(void)
{
TestApplication application;
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 >();
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 );
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 );
END_TEST;
}
-// SetSize(float width, float height, float depth)
int UtcDaliActorSetSize02(void)
{
TestApplication application;
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 >();
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 >();
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 >();
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 >();
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();
DALI_TEST_CHECK(vector != actor.GetTargetSize());
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.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
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();
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.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.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.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();
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.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();
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.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ));
- actor.SetPosition(vector);
+ actor.SetProperty( Actor::Property::POSITION, vector);
// flush the queue and render once
application.SendNotification();
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();
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();
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();
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();
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();
Actor parent = Actor::New();
Vector3 parentPosition( 1.0f, 2.0f, 3.0f );
- parent.SetPosition( parentPosition );
+ 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 );
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
Actor parent = Actor::New();
Vector3 parentPosition( 1.0f, 2.0f, 3.0f );
- parent.SetPosition( parentPosition );
+ 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 );
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
//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.SetProperty( Actor::Property::INHERIT_POSITION, false );
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();
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();
actor.RotateBy( Degree( 360 ), axis);
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.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();
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();
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
Actor actor = Actor::New();
// Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale()
- actor.SetScale(0.25f);
+ actor.SetProperty( Actor::Property::SCALE,0.25f);
Vector3 scale(10.0f, 10.0f, 10.0f);
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();
Actor actor = Actor::New();
// Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale()
- actor.SetScale(Vector3(12.0f, 1.0f, 2.0f));
+ actor.SetProperty( Actor::Property::SCALE, Vector3( 12.0f, 1.0f, 2.0f ) );
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();
// 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();
Actor actor = Actor::New();
// Set to random value first -.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) asserts if called before SetScale()
- actor.SetScale(Vector3(12.0f, 1.0f, 2.0f));
+ actor.SetProperty( Actor::Property::SCALE, Vector3(12.0f, 1.0f, 2.0f));
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();
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();
Actor actor = Actor::New();
- actor.SetScale(scale);
+ actor.SetProperty( Actor::Property::SCALE,scale);
// flush the queue and render once
application.SendNotification();
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
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();
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.GetCurrentProperty< Vector4 >( Actor::Property::WORLD_COLOR ), Color::WHITE, 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.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.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 );
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;
}
TestApplication application;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- actor.SetSize(100.0f, 100.0f);
- actor.SetPosition(10.0f, 10.0f);
+ 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
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();
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;
}
// 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();
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();
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();
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();
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();
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;
}
{ "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 },
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;
}
// 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 );
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();
Actor actor = Actor::New();
Padding padding;
- actor.GetPadding( padding );
+ padding = actor.GetProperty<Vector4>( Actor::Property::PADDING );
DALI_TEST_EQUALS( padding.left, 0.0f, TEST_LOCATION );
DALI_TEST_EQUALS( padding.right, 0.0f, TEST_LOCATION );
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<Vector4>( Actor::Property::PADDING );
DALI_TEST_EQUALS( padding.left, padding2.left, TEST_LOCATION );
DALI_TEST_EQUALS( padding.right, padding2.right, TEST_LOCATION );
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();
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;
}
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;
}
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;
}
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;
}
// Setup dimensions and position so actor is not skipped by culling.
actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- actor.SetSize( width, height );
+ actor.SetProperty( Actor::Property::SIZE, Vector2( width, height ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
// 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 )
{
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 );
{
// 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 );
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 );
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" );
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();
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();
tet_infoline( "UtcDaliActorGetScreenPosition Scale parent and check child's screen position \n" );
actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- actorA.SetPosition( 30.0, 30.0 );
+ actorA.SetProperty( Actor::Property::POSITION, Vector2( 30.0, 30.0 ));
Actor actorB = Actor::New();
actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- actorB.SetSize( size2 );
- actorB.SetPosition( 10.f, 10.f );
+ 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();
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" );
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" );
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" );
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" );
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" );
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" );
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" );
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" );
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" );
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();
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();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- actor.SetSize( 100.0f, 100.0f );
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Stage::GetCurrent().Add( actor );
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- actor.SetSize( 100.0f, 100.0f );
- actor.SetScale( 2.0f );
+ 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 );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- actor.SetSize( 100.0f, 100.0f );
- actor.SetOrientation( Degree( 90.0f), Vector3::ZAXIS );
+ 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 );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- actor.SetSize( 100.0f, 100.0f );
- actor.SetOrientation( Degree( 90.0f), Vector3::ZAXIS );
- actor.SetScale( 2.0f );
+ 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 );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- actor.SetSize( 100.0f, 100.0f );
+ 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 );
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();
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();
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();
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();
int utcDaliActorGetSizeAfterAnimation(void)
{
TestApplication application;
- tet_infoline( "Check the actor size when an animation is finished" );
+ tet_infoline( "Check the actor size before / after an animation is finished" );
- Vector3 vector( 100.0f, 100.0f, 0.0f );
+ Vector3 actorSize( 100.0f, 100.0f, 0.0f );
Actor actor = Actor::New();
- actor.SetSize( vector.x, vector.y );
+ 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();
- Vector3 size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >();
- DALI_TEST_EQUALS( size, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION );
- DALI_TEST_EQUALS( vector.width, actor.GetProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION );
- DALI_TEST_EQUALS( vector.height, actor.GetProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION );
- DALI_TEST_EQUALS( vector.depth, actor.GetProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION );
+ // 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, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION );
- DALI_TEST_EQUALS( vector.width, actor.GetCurrentProperty< float >( Actor::Property::SIZE_WIDTH ), TEST_LOCATION );
- DALI_TEST_EQUALS( vector.height, actor.GetCurrentProperty< float >( Actor::Property::SIZE_HEIGHT ), TEST_LOCATION );
- DALI_TEST_EQUALS( vector.depth, actor.GetCurrentProperty< float >( Actor::Property::SIZE_DEPTH ), TEST_LOCATION );
+ 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, 30.0f );
+ 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
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, 30.0f );
+ Vector3 offset( 10.0f, 20.0f, 0.0f );
animation.Clear();
animation.AnimateBy( Property( actor, Actor::Property::SIZE ), offset );
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;
}