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
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;
}
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();
Quaternion parentRotation(rotationAngle, Vector3::ZAXIS);
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
parent.SetPosition( parentPosition );
- parent.SetOrientation( parentRotation );
+ parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
parent.SetScale( parentScale );
Stage::GetCurrent().Add( parent );
Quaternion childRotation( childRotationAngle, Vector3::YAXIS );
Vector3 childScale( 2.0f, 2.0f, 2.0f );
child.SetPosition( childPosition );
- child.SetOrientation( childRotation );
+ child.SetProperty( Actor::Property::ORIENTATION, childRotation );
child.SetScale( childScale );
parent.Add( child );
Quaternion parentRotation(rotationAngle, Vector3::ZAXIS);
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
parent.SetPosition( parentPosition );
- parent.SetOrientation( parentRotation );
+ parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
parent.SetScale( parentScale );
Stage::GetCurrent().Add( parent );
Quaternion parentRotation(rotationAngle, Vector3::ZAXIS);
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
parent.SetPosition( parentPosition );
- parent.SetOrientation( parentRotation );
+ parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
parent.SetScale( parentScale );
Stage::GetCurrent().Add( parent );
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 );
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 );
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;
}
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::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) );
actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
Stage::GetCurrent().Add( actor );
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::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) );
actor.SetScale( 2.0f );
actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
Stage::GetCurrent().Add( actor );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
tet_printf("Testing that rotation angle > 360 performs full rotations\n");
Actor actor = Actor::New();
- actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION );
tet_printf("Testing that rotation angle > 360 performs partial rotations when cast to Quaternion\n");
Actor actor = Actor::New();
- actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation( Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- actor.SetOrientation(Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
Stage::GetCurrent().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
- actor.SetOrientation(aa.angle, aa.axis);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
Stage::GetCurrent().Add(actor);
application.SendNotification();
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
- actor.SetOrientation(aa.angle, aa.axis);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
Stage::GetCurrent().Add(actor);
application.SendNotification();
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
- actor.SetOrientation(aa.angle, aa.axis);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
Stage::GetCurrent().Add(actor);
application.SendNotification();
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
- actor.SetOrientation(aa.angle, aa.axis);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
application.SendNotification();
application.Render(0);
Stage::GetCurrent().Add(actor);
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
- actor.SetOrientation(aa.angle, aa.axis);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
Stage::GetCurrent().Add(actor);
application.SendNotification();
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
- actor.SetOrientation(aa.angle, aa.axis);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
application.SendNotification();
application.Render(0);
Stage::GetCurrent().Add(actor);
{ "leaveRequired", Property::BOOLEAN, true, false, false, Dali::Actor::Property::LEAVE_REQUIRED },
{ "inheritOrientation", Property::BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_ORIENTATION },
{ "inheritScale", Property::BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_SCALE },
- { "colorMode", Property::STRING, true, false, false, Dali::Actor::Property::COLOR_MODE },
- { "drawMode", Property::STRING, true, false, false, Dali::Actor::Property::DRAW_MODE },
+ { "colorMode", Property::INTEGER, true, false, false, Dali::Actor::Property::COLOR_MODE },
+ { "drawMode", Property::INTEGER, true, false, false, Dali::Actor::Property::DRAW_MODE },
{ "sizeModeFactor", Property::VECTOR3, true, false, false, Dali::Actor::Property::SIZE_MODE_FACTOR },
{ "widthResizePolicy", Property::STRING, true, false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY },
{ "heightResizePolicy", Property::STRING, true, false, false, Dali::Actor::Property::HEIGHT_RESIZE_POLICY },
- { "sizeScalePolicy", Property::STRING, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY },
+ { "sizeScalePolicy", Property::INTEGER, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY },
{ "widthForHeight", Property::BOOLEAN, true, false, false, Dali::Actor::Property::WIDTH_FOR_HEIGHT },
{ "heightForWidth", Property::BOOLEAN, true, false, false, Dali::Actor::Property::HEIGHT_FOR_WIDTH },
{ "padding", Property::VECTOR4, true, false, false, Dali::Actor::Property::PADDING },
Quaternion cameraOrientation( Radian( Degree( 180.0f ) ), Vector3::YAXIS );
freeLookCameraActor.SetPosition( cameraOffset );
- freeLookCameraActor.SetOrientation( cameraOrientation );
+ freeLookCameraActor.SetProperty( Actor::Property::ORIENTATION, cameraOrientation );
Actor cameraAnchor = Actor::New();
cameraAnchor.Add( freeLookCameraActor );
Quaternion rotation( Radian( Degree( angle ) ), Vector3::YAXIS );
freeLookCameraActor.SetPosition( rotation.Rotate( cameraOffset ) );
- cameraAnchor.SetOrientation( rotation );
+ cameraAnchor.SetProperty( Actor::Property::ORIENTATION, rotation );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( reflected, rotation, 0.01f, TEST_LOCATION );
END_TEST;
-}
\ No newline at end of file
+}
Vector2 actorSize( stageSize * 0.5f );
// Create two actors with half the size of the stage and set them to be partially overlapping
Actor blue = Actor::New();
- blue.SetDrawMode( DrawMode::OVERLAY_2D );
+ blue.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
blue.SetProperty( Actor::Property::NAME, "Blue" );
blue.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
blue.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3(1.0f/3.0f, 1.0f/3.0f, 0.5f) );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
- actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::Degree(90.0f), Vector3::ZAXIS ) );
Stage::GetCurrent().Add(actor);
// Render and notify
DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
// Rotate actor again and render
- actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
// Rotate actor again and render
- actor.SetOrientation(Dali::Degree(90.0f), Vector3::YAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) );
application.SendNotification();
application.Render();
child.SetSize(100.0f, 100.0f);
child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
parent.Add(child);
TouchEventFunctor touchFunctor;
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
- actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
Stage::GetCurrent().Add(actor);
// Render and notify
DALI_TEST_EQUALS(Vector2(16.0f, 2.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
// Rotate actor again and render a couple of times
- actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS(Vector2(2.0f, -16.0f), data.receivedGesture.displacement, 0.01f, TEST_LOCATION); // Actor relative
// Rotate actor again and render a couple of times
- actor.SetOrientation(Dali::Degree(270.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
child.SetSize(100.0f, 100.0f);
child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
parent.Add(child);
TouchEventFunctor touchFunctor;
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
- actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
Stage::GetCurrent().Add(actor);
// Render and notify a couple of times
DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
// Rotate actor again and render and notify
- actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS(Vector2(20.0f, 20.0f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
// Rotate actor again and render and notify
- actor.SetOrientation(Dali::Degree(270.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
child.SetSize(100.0f, 100.0f);
child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
parent.Add(child);
TouchEventFunctor touchFunctor;
*/
Actor actor0 = CreateActor( root, 0, TEST_LOCATION );
- actor0.SetDrawMode( DrawMode::OVERLAY_2D );
+ actor0.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
Renderer renderer0 = CreateRenderer( actor0, geometry, shader, 0 );
Actor actor1 = CreateActor( root, 0, TEST_LOCATION );
- actor1.SetDrawMode( DrawMode::OVERLAY_2D );
+ actor1.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
Renderer renderer1 = CreateRenderer( actor1, geometry, shader, 0 );
Actor actor2 = CreateActor( root, 0, TEST_LOCATION );
Renderer renderer2 = CreateRenderer( actor2, geometry, shader, 0 );
Actor actor3 = CreateActor( root, 0, TEST_LOCATION );
- actor3.SetDrawMode( DrawMode::OVERLAY_2D );
+ actor3.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
Renderer renderer3 = CreateRenderer( actor3, geometry, shader, 0 );
Actor actor4 = CreateActor( root, 0, TEST_LOCATION );
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
- actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
Stage::GetCurrent().Add(actor);
// Render and notify a couple of times
DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
// Rotate actor again and render and notify
- actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS(Vector2(23.0f, 17.5f), data.receivedGesture.screenCenterPoint, 0.01f, TEST_LOCATION);
// Rotate actor again and render and notify
- actor.SetOrientation(Dali::Degree(270.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(270.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
child.SetSize(100.0f, 100.0f);
child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
parent.Add(child);
TouchEventFunctor touchFunctor;
DALI_TEST_EQUALS( handle.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), false, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::MAGENTA, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetProperty< std::string >( Actor::Property::NAME ), "MyActor", TEST_LOCATION );
- DALI_TEST_EQUALS( handle.GetColorMode(), USE_PARENT_COLOR, TEST_LOCATION );
+ DALI_TEST_EQUALS( handle.GetProperty< ColorMode >( Actor::Property::COLOR_MODE ), USE_PARENT_COLOR, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::SENSITIVE ), false, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::LEAVE_REQUIRED ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( handle.GetDrawMode(), DrawMode::OVERLAY_2D, TEST_LOCATION );
+ DALI_TEST_EQUALS( handle.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ), DrawMode::OVERLAY_2D, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::INHERIT_ORIENTATION ), false, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::INHERIT_SCALE ), false, TEST_LOCATION );
actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
actor.SetProperty( Actor::Property::INHERIT_ORIENTATION, false );
actor.SetProperty( Actor::Property::INHERIT_SCALE, false );
- actor.SetSizeModeFactor( Vector3::ONE );
+ actor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3::ONE );
Stage::GetCurrent().Add( actor );
application.SendNotification();
Stage::GetCurrent().Remove( actor );
}
- // ColorMode
- TestEnumStrings< ColorMode >( "colorMode", application, COLOR_MODE_VALUES, COLOR_MODE_VALUES_COUNT, &Actor::SetColorMode );
-
- // DrawMode
- TestEnumStrings< DrawMode::Type >( "drawMode", application, DRAW_MODE_VALUES, DRAW_MODE_VALUES_COUNT, &Actor::SetDrawMode );
-
// Children
{
Actor actor = Actor::New();
Actor actor = Actor::New();
actor.SetSize(100.0f, 100.0f);
- actor.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
Stage::GetCurrent().Add(actor);
// Render and notify
DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
// Rotate actor again and render
- actor.SetOrientation(Dali::Degree(180.0f), Vector3::ZAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(180.0f), Vector3::ZAXIS) );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( Vector2(5.0f, 5.0f), data.receivedGesture.screenPoint, 0.1, TEST_LOCATION);
// Rotate actor again and render
- actor.SetOrientation(Dali::Degree(90.0f), Vector3::YAXIS);
+ actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::YAXIS) );
application.SendNotification();
application.Render();
child.SetSize(100.0f, 100.0f);
child.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- child.SetOrientation(Dali::Degree(90.0f), Vector3::ZAXIS);
+ child.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
parent.Add(child);
TouchEventFunctor touchFunctor;
DALI_PROPERTY( "leaveRequired", BOOLEAN, true, false, false, Dali::Actor::Property::LEAVE_REQUIRED )
DALI_PROPERTY( "inheritOrientation", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_ORIENTATION )
DALI_PROPERTY( "inheritScale", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_SCALE )
-DALI_PROPERTY( "colorMode", STRING, true, false, false, Dali::Actor::Property::COLOR_MODE )
+DALI_PROPERTY( "colorMode", INTEGER, true, false, false, Dali::Actor::Property::COLOR_MODE )
DALI_PROPERTY( "reservedProperty01", STRING, true, false, false, Dali::Actor::Property::RESERVED_PROPERTY_01 ) // This property was removed, but to keep binary compatibility and TypeRegister test app, remain it here.
-DALI_PROPERTY( "drawMode", STRING, true, false, false, Dali::Actor::Property::DRAW_MODE )
+DALI_PROPERTY( "drawMode", INTEGER, true, false, false, Dali::Actor::Property::DRAW_MODE )
DALI_PROPERTY( "sizeModeFactor", VECTOR3, true, false, false, Dali::Actor::Property::SIZE_MODE_FACTOR )
DALI_PROPERTY( "widthResizePolicy", STRING, true, false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY )
DALI_PROPERTY( "heightResizePolicy", STRING, true, false, false, Dali::Actor::Property::HEIGHT_RESIZE_POLICY )
-DALI_PROPERTY( "sizeScalePolicy", STRING, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY )
+DALI_PROPERTY( "sizeScalePolicy", INTEGER, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY )
DALI_PROPERTY( "widthForHeight", BOOLEAN, true, false, false, Dali::Actor::Property::WIDTH_FOR_HEIGHT )
DALI_PROPERTY( "heightForWidth", BOOLEAN, true, false, false, Dali::Actor::Property::HEIGHT_FOR_WIDTH )
DALI_PROPERTY( "padding", VECTOR4, true, false, false, Dali::Actor::Property::PADDING )
case Dali::Actor::Property::SIZE_SCALE_POLICY:
{
SizeScalePolicy::Type type = GetSizeScalePolicy();
- if( Scripting::GetEnumeration< SizeScalePolicy::Type >( property.Get< std::string >().c_str(), SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) )
+ if( Scripting::GetEnumerationProperty< SizeScalePolicy::Type >( property, SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) )
{
SetSizeScalePolicy( type );
}
case Dali::Actor::Property::COLOR_MODE:
{
- value = Scripting::GetLinearEnumerationName< ColorMode >( GetColorMode(), COLOR_MODE_TABLE, COLOR_MODE_TABLE_COUNT );
+ value = GetColorMode();
break;
}
case Dali::Actor::Property::DRAW_MODE:
{
- value = Scripting::GetEnumerationName< DrawMode::Type >( GetDrawMode(), DRAW_MODE_TABLE, DRAW_MODE_TABLE_COUNT );
+ value = GetDrawMode();
break;
}
case Dali::Actor::Property::SIZE_SCALE_POLICY:
{
- value = Scripting::GetLinearEnumerationName< SizeScalePolicy::Type >( GetSizeScalePolicy(), SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT );
+ value = GetSizeScalePolicy();
break;
}
case ResizePolicy::SIZE_RELATIVE_TO_PARENT:
{
- return GetLatestSize( dimension ) * GetDimensionValue( child.GetSizeModeFactor(), dimension );
+ return GetLatestSize( dimension ) * GetDimensionValue( child.GetProperty< Vector3 >( Dali::Actor::Property::SIZE_MODE_FACTOR ), dimension );
}
case ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT:
{
- return GetLatestSize( dimension ) + GetDimensionValue( child.GetSizeModeFactor(), dimension );
+ return GetLatestSize( dimension ) + GetDimensionValue( child.GetProperty< Vector3 >( Dali::Actor::Property::SIZE_MODE_FACTOR ), dimension );
}
default:
GetImplementation(*this).TranslateBy(distance);
}
-void Actor::SetOrientation(const Radian& angle, const Vector3& axis)
-{
- GetImplementation(*this).SetOrientation(angle, axis);
-}
-
-void Actor::SetOrientation(const Quaternion& orientation)
-{
- GetImplementation(*this).SetOrientation(orientation);
-}
-
void Actor::RotateBy(const Radian& angle, const Vector3& axis)
{
GetImplementation(*this).RotateBy(angle, axis);
GetImplementation(*this).ScaleBy(relativeScale);
}
-void Actor::SetSizeModeFactor(const Vector3& factor)
-{
- GetImplementation(*this).SetSizeModeFactor(factor);
-}
-
-Vector3 Actor::GetSizeModeFactor() const
-{
- return GetImplementation(*this).GetSizeModeFactor();
-}
-
-void Actor::SetColorMode( ColorMode colorMode )
-{
- GetImplementation(*this).SetColorMode(colorMode);
-}
-
-ColorMode Actor::GetColorMode() const
-{
- return GetImplementation(*this).GetColorMode();
-}
-
-void Actor::SetDrawMode( DrawMode::Type drawMode )
-{
- GetImplementation(*this).SetDrawMode( drawMode );
-}
-
-DrawMode::Type Actor::GetDrawMode() const
-{
- return GetImplementation(*this).GetDrawMode();
-}
-
bool Actor::ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const
{
return GetImplementation(*this).ScreenToLocal(localX, localY, screenX, screenY);
return GetImplementation(*this).GetResizePolicy( dimension );
}
-void Actor::SetSizeScalePolicy( SizeScalePolicy::Type policy )
-{
- GetImplementation(*this).SetSizeScalePolicy( policy );
-}
-
-SizeScalePolicy::Type Actor::GetSizeScalePolicy() const
-{
- return GetImplementation(*this).GetSizeScalePolicy();
-}
-
float Actor::GetHeightForWidth( float width )
{
return GetImplementation(*this).GetHeightForWidth( width );
return GetImplementation(*this).GetRelayoutSize( dimension );
}
-void Actor::SetPadding( const Padding& padding )
-{
- Internal::Actor& impl = GetImplementation(*this);
-
- Vector2 widthPadding( padding.left, padding.right );
- impl.SetPadding( widthPadding, Dimension::WIDTH );
-
- Vector2 heightPadding( padding.bottom, padding.top );
- impl.SetPadding( heightPadding, Dimension::HEIGHT );
-}
-
-void Actor::GetPadding( Padding& paddingOut ) const
-{
- const Internal::Actor& impl = GetImplementation(*this);
-
- Vector2 widthPadding = impl.GetPadding( Dimension::WIDTH );
- Vector2 heightPadding = impl.GetPadding( Dimension::HEIGHT );
-
- paddingOut.left = widthPadding.x;
- paddingOut.right = widthPadding.y;
- paddingOut.bottom = heightPadding.x;
- paddingOut.top = heightPadding.y;
-}
-
int32_t Actor::GetHierarchyDepth()
{
return GetImplementation(*this).GetHierarchyDepth();
*
* Hit Priority of above Actor tree (all overlays): 1 - Lowest. 6 - Highest.
* @endcode
- * For more information, see SetDrawMode().
+ * For more information, see Property::DRAW_MODE.
*
* <i>Touch or hover Event Delivery:</i>
*
* @brief The orientation of an actor.
* @details Name "orientation", type Property::ROTATION, animatable / constraint-input
* @SINCE_1_0.0
- * @see Actor::SetOrientation()
*/
ORIENTATION,
* @brief The color mode of an actor.
* @details Name "colorMode", type ColorMode (Property::INTEGER) or Property::STRING.
* @SINCE_1_0.0
- * @see Actor::SetColorMode()
*/
COLOR_MODE,
* @brief The draw mode of an actor.
* @details Name "drawMode", type DrawMode::Type (Property::INTEGER) or Property::STRING.
* @SINCE_1_0.0
- * @see Actor::SetDrawMode()
*/
DRAW_MODE,
/**
* @brief The size scale policy of an actor.
- * @details Name "sizeScalePolicy", type ResizePolicy::Type (Property::INTEGER) or Property::STRING.
+ * @details Name "sizeScalePolicy", type SizeScalePolicy::Type (Property::INTEGER) or Property::STRING.
* @SINCE_1_0.0
- * @see Actor::SetSizeScalePolicy()
*/
SIZE_SCALE_POLICY,
* @brief The padding of an actor for use in layout.
* @details Name "padding", type Property::VECTOR4.
* @SINCE_1_0.0
- * @see Actor::SetPadding()
*/
PADDING,
void TranslateBy(const Vector3& distance);
/**
- * @brief Sets the orientation of the Actor.
- *
- * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
- * @SINCE_1_0.0
- * @param[in] angle The new orientation angle in degrees
- * @param[in] axis The new axis of orientation
- * @pre The Actor has been initialized.
- * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation().
- */
- void SetOrientation( const Degree& angle, const Vector3& axis )
- {
- SetOrientation( Radian( angle ), axis );
- }
-
- /**
- * @brief Sets the orientation of the Actor.
- *
- * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
- * @SINCE_1_0.0
- * @param[in] angle The new orientation angle in radians
- * @param[in] axis The new axis of orientation
- * @pre The Actor has been initialized.
- * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation().
- */
- void SetOrientation(const Radian& angle, const Vector3& axis);
-
- /**
- * @brief Sets the orientation of the Actor.
- *
- * An actor's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
- * @SINCE_1_0.0
- * @param[in] orientation The new orientation
- * @pre The Actor has been initialized.
- * @note This is an asynchronous method; the value written may not match a value subsequently read with GetCurrentOrientation().
- */
- void SetOrientation(const Quaternion& orientation);
-
- /**
* @brief Applies a relative rotation to an actor.
*
* @SINCE_1_0.0
*/
void ScaleBy(const Vector3& relativeScale);
- // Visibility & Color
-
- /**
- * @brief Sets the actor's color mode.
- *
- * This specifies whether the Actor uses its own color, or inherits
- * its parent color. The default is USE_OWN_MULTIPLY_PARENT_ALPHA.
- * @SINCE_1_0.0
- * @param[in] colorMode ColorMode to use
- * @pre The Actor has been initialized.
- */
- void SetColorMode( ColorMode colorMode );
-
- /**
- * @brief Returns the actor's color mode.
- *
- * @SINCE_1_0.0
- * @return Currently used colorMode
- * @pre The Actor has been initialized.
- */
- ColorMode GetColorMode() const;
-
- /**
- * @brief Sets how the actor and its children should be drawn.
- *
- * Not all actors are renderable, but DrawMode can be inherited from any actor.
- * If an object is in a 3D layer, it will be depth-tested against
- * other objects in the world i.e. it may be obscured if other objects are in front.
- *
- * If DrawMode::OVERLAY_2D is used, the actor and its children will be drawn as a 2D overlay.
- * Overlay actors are drawn in a separate pass, after all non-overlay actors within the Layer.
- * For overlay actors, the drawing order is with respect to tree levels of Actors,
- * and depth-testing will not be used.
-
- * @SINCE_1_0.0
- * @param[in] drawMode The new draw-mode to use
- * @note Layers do not inherit the DrawMode from their parents.
- */
- void SetDrawMode( DrawMode::Type drawMode );
-
- /**
- * @brief Queries how the actor and its children will be drawn.
- *
- * @SINCE_1_0.0
- * @return Return the draw mode type
- */
- DrawMode::Type GetDrawMode() const;
-
// Input Handling
/**
ResizePolicy::Type GetResizePolicy( Dimension::Type dimension ) const;
/**
- * @brief Sets the policy to use when setting size with size negotiation. Defaults to SizeScalePolicy::USE_SIZE_SET.
- *
- * @SINCE_1_0.0
- * @param[in] policy The policy to use for when the size is set
- */
- void SetSizeScalePolicy( SizeScalePolicy::Type policy );
-
- /**
- * @brief Returns the size scale policy in use.
- *
- * @SINCE_1_0.0
- * @return Return the size scale policy
- */
- SizeScalePolicy::Type GetSizeScalePolicy() const;
-
- /**
- * @brief Sets the relative to parent size factor of the actor.
- *
- * This factor is only used when ResizePolicy is set to either:
- * ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
- * This actor's size is set to the actor's size multiplied by or added to this factor,
- * depending on ResizePolicy ( See SetResizePolicy() ).
- *
- * @SINCE_1_0.0
- * @param[in] factor A Vector3 representing the relative factor to be applied to each axis
- * @pre The Actor has been initialized.
- */
- void SetSizeModeFactor( const Vector3& factor );
-
- /**
- * @brief Retrieves the relative to parent size factor of the actor.
- *
- * @SINCE_1_0.0
- * @return The Actor's current relative size factor
- * @pre The Actor has been initialized.
- */
- Vector3 GetSizeModeFactor() const;
-
- /**
* @brief Calculates the height of the actor given a width.
*
* The natural size is used for default calculation.
float GetRelayoutSize( Dimension::Type dimension ) const;
/**
- * @brief Sets the padding for use in layout.
- *
- * @SINCE_1_0.0
- * @param[in] padding Padding for the actor
- */
- void SetPadding( const Padding& padding );
-
- /**
- * @brief Returns the value of the padding.
- *
- * @SINCE_1_0.0
- * @param[in] paddingOut The returned padding data
- */
- void GetPadding( Padding& paddingOut ) const;
-
- /**
* @brief Gets depth in the hierarchy for the actor.
*
* @SINCE_1_0.0
#define DALI_RECT_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
/**
+ * @brief Conversion constructor from Vector4.
+ *
+ * @SINCE_1_9.14
+ * @param[in] vec4 Vector4 to convert from
+ */
+ Rect( const Vector4& vec4 )
+ {
+ x = vec4.x;
+ y = vec4.y;
+ width = vec4.z;
+ height = vec4.w;
+ }
+
+ /**
* @brief Copy constructor.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
{
}
+ Impl( const Rect<float>& rectValue )
+ : type( Property::VECTOR4 ),
+ vector4Value( new Vector4( rectValue.x, rectValue.y, rectValue.width, rectValue.height ) )
+ {
+ }
+
Impl( const Property::Array& arrayValue )
: type( Property::ARRAY ),
arrayValue( new Property::Array( arrayValue ) )
{
}
+Property::Value::Value( const Rect<float>& rectValue )
+: mImpl( new Impl( rectValue ) )
+{
+}
+
Property::Value::Value( const AngleAxis& angleAxisValue )
: mImpl( new Impl( angleAxisValue ) )
{
#define DALI_PROPERTY_VALUE_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Value( const Rect<int32_t>& vectorValue );
/**
+ * @brief Creates a Vector4 property value.
+ *
+ * @SINCE_1_9.14
+ * @param[in] vectorValue A vector of 4 float values
+ */
+ Value( const Rect<float>& vectorValue );
+
+ /**
* @brief Creates an orientation property value.
*
* @SINCE_1_0.0