/*
- * 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.
unsigned int mValue;
};
-static bool TestCallback(Actor actor, const TouchEvent& event)
-{
- gTouchCallBackCalled = true;
- return false;
- END_TEST;
-}
-static bool TestTouchCallback(Actor actor, const TouchData& touchData )
+static bool TestTouchCallback(Actor, const TouchEvent&)
{
gTouchCallBackCalled = true;
return true;
END_TEST;
}
-static bool TestTouchCallback2(Actor actor, const TouchData& touchData )
+static bool TestTouchCallback2(Actor, const TouchEvent&)
{
gTouchCallBackCalled2 = true;
return true;
END_TEST;
}
-static bool TestTouchCallback3(Actor actor, const TouchData& touchData )
+static bool TestTouchCallback3(Actor, const TouchEvent&)
{
gTouchCallBackCalled3 = true;
return true;
}
// validation stuff for onstage & offstage signals
-static std::vector< std::string > gActorNamesOnOffStage;
-static int gOnStageCallBackCalled;
-void OnStageCallback( Actor actor )
+static std::vector< std::string > gActorNamesOnOffScene;
+static int gOnSceneCallBackCalled;
+void OnSceneCallback( Actor actor )
{
- ++gOnStageCallBackCalled;
- gActorNamesOnOffStage.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) );
- DALI_TEST_CHECK( actor.OnStage() == true );
+ ++gOnSceneCallBackCalled;
+ gActorNamesOnOffScene.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == true );
}
-static int gOffStageCallBackCalled;
-void OffStageCallback( Actor actor )
+static int gOffSceneCallBackCalled;
+void OffSceneCallback( Actor actor )
{
- ++gOffStageCallBackCalled;
- gActorNamesOnOffStage.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) );
- DALI_TEST_CHECK( actor.OnStage() == false );
+ ++gOffSceneCallBackCalled;
+ gActorNamesOnOffScene.push_back( actor.GetProperty< std::string >( Actor::Property::NAME ) );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) == false );
}
struct PositionComponentConstraint
END_TEST;
}
+int UtcDaliActorMoveConstructor(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_CHECK( actor );
+
+ int id = actor.GetProperty< int >( Actor::Property::ID );
+
+ Actor moved = std::move( actor);
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+ DALI_TEST_CHECK( !actor );
+
+ END_TEST;
+}
+
+int UtcDaliActorMoveAssignment(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_CHECK( actor );
+
+ int id = actor.GetProperty< int >( Actor::Property::ID );
+
+ Actor moved;
+ moved = std::move( actor);
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+ DALI_TEST_CHECK( !actor );
+
+ END_TEST;
+}
+
//& purpose: Testing Dali::Actor::GetName()
int UtcDaliActorGetName(void)
{
int UtcDaliActorGetId(void)
{
- tet_infoline("Testing Dali::Actor::UtcDaliActorGetId()");
+ tet_infoline("Testing Dali::Actor::UtcDaliActo.GetProperty< int >( Actor::Property::ID )");
TestApplication application;
Actor first = Actor::New();
Actor second = Actor::New();
Actor third = Actor::New();
- DALI_TEST_CHECK(first.GetId() != second.GetId());
- DALI_TEST_CHECK(second.GetId() != third.GetId());
+ DALI_TEST_CHECK(first.GetProperty< int >( Actor::Property::ID ) != second.GetProperty< int >( Actor::Property::ID ));
+ DALI_TEST_CHECK(second.GetProperty< int >( Actor::Property::ID ) != third.GetProperty< int >( Actor::Property::ID ));
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK(!actor.IsRoot());
+ DALI_TEST_CHECK(!actor.GetProperty< bool >( Actor::Property::IS_ROOT ));
// get the root layer
- actor = Stage::GetCurrent().GetLayer( 0 );
- DALI_TEST_CHECK( actor.IsRoot() );
+ actor = application.GetScene().GetLayer( 0 );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::IS_ROOT ) );
END_TEST;
}
-int UtcDaliActorOnStage(void)
+int UtcDaliActorOnScene(void)
{
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.OnStage() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
// get the root layer
- actor = Stage::GetCurrent().GetLayer( 0 );
- DALI_TEST_CHECK( actor.OnStage() );
+ actor = application.GetScene().GetLayer( 0 );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK( !actor.IsLayer() );
+ DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::IS_LAYER ) );
// get the root layer
- actor = Stage::GetCurrent().GetLayer( 0 );
- DALI_TEST_CHECK( actor.IsLayer() );
+ actor = application.GetScene().GetLayer( 0 );
+ DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::IS_LAYER ) );
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Layer layer = actor.GetLayer();
DALI_TEST_CHECK(layer);
// get the root layers layer
- actor = Stage::GetCurrent().GetLayer( 0 );
+ actor = application.GetScene().GetLayer( 0 );
DALI_TEST_CHECK( actor.GetLayer() );
END_TEST;
}
// try reparenting root
try
{
- parent2.Add( Stage::GetCurrent().GetLayer( 0 ) );
+ parent2.Add( application.GetScene().GetLayer( 0 ) );
tet_printf("Assertion test failed - no Exception\n" );
tet_result(TET_FAIL);
}
Actor child = Actor::New();
Actor random = Actor::New();
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
DALI_TEST_CHECK(parent.GetChildCount() == 0);
DALI_TEST_CHECK(parent.GetChildCount() == 1);
- Stage::GetCurrent().Remove( parent );
+ application.GetScene().Remove( parent );
DALI_TEST_CHECK(parent.GetChildCount() == 1);
END_TEST;
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
float startValue(1.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
float startValue(5.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
int startValue(5);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ));
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.1f, 0.2f, 0.3f ) );
DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ));
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.SetProperty( Actor::Property::ANCHOR_POINT, Vector3( 0.1f, 0.2f, 0.3f ) );
// flush the queue and render once
DALI_TEST_EQUALS( Vector3( 0.1f, 0.2f, 0.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
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 >();
// Check the size in the new frame
DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
- Stage::GetCurrent().Add( actor );
- actor.SetSize( Vector3( 0.1f, 0.2f, 0.3f ) );
+ application.GetScene().Add( actor );
+ 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 >();
currentSize = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >();
DALI_TEST_EQUALS( currentSize, Vector3( 0.1f, 0.2f, 0.3f ), Math::MACHINE_EPSILON_0, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
Actor actor = Actor::New();
actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Vector3 vector( 100.0f, 200.0f, 400.0f );
DALI_TEST_CHECK( vector != actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) );
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();
DALI_TEST_EQUALS( expectedExtent.width, actualExtent.width, Math::MACHINE_EPSILON_10000, TEST_LOCATION );
DALI_TEST_EQUALS( expectedExtent.height, actualExtent.height, Math::MACHINE_EPSILON_10000, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
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 ) );
+ application.GetScene().Add( actor );
+ 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();
application.Render();
DALI_TEST_EQUALS( Vector3( 1.1f, 1.2f, 1.3f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Math::MACHINE_EPSILON_10000, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
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 );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
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 );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
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 );
Actor parent = Actor::New();
Actor child = Actor::New();
parent.Add( child );
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
application.SendNotification();
application.Render();
- parent.SetProperty( DevelActor::Property::OPACITY, 0.1f );
+ parent.SetProperty( Actor::Property::OPACITY, 0.1f );
DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
application.Render();
DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION);
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.RotateBy( Degree( 360 ), axis);
DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION);
application.Render();
DALI_TEST_EQUALS(rotation, actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION);
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
application.Render();
DALI_TEST_EQUALS(Quaternion( angle, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION);
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.RotateBy( angle, Vector3::ZAXIS);
// flush the queue and render once
application.Render();
DALI_TEST_EQUALS(Quaternion(angle * 2.0f, Vector3::ZAXIS), actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION);
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
Radian rotationAngle( Degree(90.0f) );
Quaternion rotation( rotationAngle, Vector3::YAXIS );
parent.SetProperty( Actor::Property::ORIENTATION, rotation );
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
child.SetProperty( Actor::Property::ORIENTATION, rotation );
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();
DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale);
// add to stage and test
- Stage::GetCurrent().Add( actor );
- actor.SetScale( 2.0f, 2.0f, 2.0f );
+ application.GetScene().Add( actor );
+ actor.SetProperty( Actor::Property::SCALE, Vector3( 2.0f, 2.0f, 2.0f ) );
// flush the queue and render once
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( Vector3( 2.0f, 2.0f, 2.0f ), actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), 0.001, TEST_LOCATION);
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
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 );
- Stage::GetCurrent().Add( parent );
+ parent.SetProperty( Actor::Property::SCALE, parentScale );
+ application.GetScene().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 );
- Stage::GetCurrent().Add( parent );
+ parent.SetProperty( Actor::Property::SCALE, parentScale );
+ application.GetScene().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_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == true);
// put actor on stage
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.SetProperty( Actor::Property::VISIBLE,false);
// flush the queue and render once
application.SendNotification();
Actor actor = Actor::New();
// initial opacity is 1
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 1.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 1.0f, TEST_LOCATION );
- actor.SetProperty( DevelActor::Property::OPACITY, 0.4f);
+ actor.SetProperty( Actor::Property::OPACITY, 0.4f);
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.4f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.4f, TEST_LOCATION );
// change opacity, actor is on stage to change is not immediate
- actor.SetProperty( DevelActor::Property::OPACITY, actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) + 0.1f );
+ actor.SetProperty( Actor::Property::OPACITY, actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) + 0.1f );
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.5f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.5f, TEST_LOCATION );
// put actor on stage
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// change opacity, actor is on stage to change is not immediate
- actor.SetProperty( DevelActor::Property::OPACITY, 0.9f );
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.5f, TEST_LOCATION );
+ actor.SetProperty( Actor::Property::OPACITY, 0.9f );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.5f, TEST_LOCATION );
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.9f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.9f, TEST_LOCATION );
// change opacity, actor is on stage to change is not immediate
- actor.SetProperty( DevelActor::Property::OPACITY, actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) - 0.9f );
+ actor.SetProperty( Actor::Property::OPACITY, actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) - 0.9f );
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.0f, TEST_LOCATION );
+ DALI_TEST_EQUALS(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.0f, TEST_LOCATION );
END_TEST;
}
TestApplication application;
Actor actor = Actor::New();
- DALI_TEST_CHECK(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) != 0.5f);
+ DALI_TEST_CHECK(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) != 0.5f);
- actor.SetProperty( DevelActor::Property::OPACITY,0.5f);
+ actor.SetProperty( Actor::Property::OPACITY,0.5f);
// flush the queue and render once
application.SendNotification();
application.Render();
- DALI_TEST_CHECK(actor.GetCurrentProperty< float >( DevelActor::Property::OPACITY ) == 0.5f);
+ DALI_TEST_CHECK(actor.GetCurrentProperty< float >( Actor::Property::OPACITY ) == 0.5f);
END_TEST;
}
application.Render();
DALI_TEST_EQUALS( Vector4( 0.6f, 0.5f, 0.4f, 0.1f ), actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.SetProperty( Actor::Property::COLOR, color );
// flush the queue and render once
application.SendNotification();
actor.SetProperty( Actor::Property::COLOR, newColor );
DALI_TEST_EQUALS( Vector4( newColor.r, newColor.g, newColor.b, 1.0f ), actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
END_TEST;
}
DALI_TEST_EQUALS( vector, actor.GetProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION );
DALI_TEST_EQUALS( vector, actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), TEST_LOCATION );
- actor.SetProperty( DevelActor::Property::OPACITY, 0.2f );
+ actor.SetProperty( Actor::Property::OPACITY, 0.2f );
// flush the queue and render once
Actor parent = Actor::New();
Vector4 parentColor( 1.0f, 0.5f, 0.0f, 0.8f );
parent.SetProperty( Actor::Property::COLOR, parentColor );
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
Vector4 childColor( 0.5f, 0.6f, 0.5f, 1.0f );
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);
- Stage::GetCurrent().Add(actor);
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+ actor.SetProperty( Actor::Property::POSITION, Vector2(10.0f, 10.0f));
+ application.GetScene().Add(actor);
// flush the queue and render once
application.SendNotification();
Actor actor = Actor::New();
- actor.SetKeyboardFocusable(true);
- DALI_TEST_CHECK(actor.IsKeyboardFocusable() == true);
+ actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, true );
+ DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == true);
- actor.SetKeyboardFocusable(false);
- DALI_TEST_CHECK(actor.IsKeyboardFocusable() == false);
+ actor.SetProperty( Actor::Property::KEYBOARD_FOCUSABLE, false );
+ DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == false);
END_TEST;
}
Actor actor = Actor::New();
- DALI_TEST_CHECK(actor.IsKeyboardFocusable() == false);
+ DALI_TEST_CHECK(actor.GetProperty< bool >( Actor::Property::KEYBOARD_FOCUSABLE ) == false);
END_TEST;
}
DALI_TEST_CHECK( gTestConstraintCalled == false );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
constraint.Apply();
// flush the queue and render once
constraint2.SetTag( constraint2Tag );
constraint2.Apply();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// flush the queue and render once
application.SendNotification();
application.Render();
ResetTouchCallbacks();
// get the root layer
- Actor actor = Stage::GetCurrent().GetRootLayer();
+ Actor actor = application.GetScene().GetRootLayer();
DALI_TEST_CHECK( gTouchCallBackCalled == false );
application.SendNotification();
application.Render();
// connect to its touch signal
- actor.TouchedSignal().Connect( TestCallback );
+ actor.TouchSignal().Connect( TestTouchCallback );
// simulate a touch event in the middle of the screen
- Vector2 touchPoint( Stage::GetCurrent().GetSize() * 0.5 );
+ Vector2 touchPoint( application.GetScene().GetSize() * 0.5 );
Dali::Integration::Point point;
point.SetDeviceId( 1 );
point.SetState( PointState::DOWN );
gHoverCallBackCalled = false;
// get the root layer
- Actor actor = Stage::GetCurrent().GetRootLayer();
+ Actor actor = application.GetScene().GetRootLayer();
DALI_TEST_CHECK( gHoverCallBackCalled == false );
application.SendNotification();
actor.HoveredSignal().Connect( TestCallback3 );
// simulate a hover event in the middle of the screen
- Vector2 touchPoint( Stage::GetCurrent().GetSize() * 0.5 );
+ Vector2 touchPoint( application.GetScene().GetSize() * 0.5 );
Dali::Integration::Point point;
point.SetDeviceId( 1 );
point.SetState( PointState::MOTION );
END_TEST;
}
-int UtcDaliActorOnOffStageSignal(void)
+int UtcDaliActorOnOffSceneSignal(void)
{
- tet_infoline("Testing Dali::Actor::OnStageSignal() and OffStageSignal()");
+ tet_infoline("Testing Dali::Actor::OnSceneSignal() and OffSceneSignal()");
TestApplication application;
// clean test data
- gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
- gActorNamesOnOffStage.clear();
+ gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0;
+ gActorNamesOnOffScene.clear();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::NAME, "parent" );
- parent.OnStageSignal().Connect( OnStageCallback );
- parent.OffStageSignal().Connect( OffStageCallback );
+ parent.OnSceneSignal().Connect( OnSceneCallback );
+ parent.OffSceneSignal().Connect( OffSceneCallback );
// sanity check
- DALI_TEST_CHECK( gOnStageCallBackCalled == 0 );
- DALI_TEST_CHECK( gOffStageCallBackCalled == 0 );
+ DALI_TEST_CHECK( gOnSceneCallBackCalled == 0 );
+ DALI_TEST_CHECK( gOffSceneCallBackCalled == 0 );
- // add parent to stage
- Stage::GetCurrent().Add( parent );
+ // add parent to the scene
+ application.GetScene().Add( parent );
// onstage emitted, offstage not
- DALI_TEST_EQUALS( gOnStageCallBackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gOffStageCallBackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( "parent", gActorNamesOnOffStage[ 0 ], TEST_LOCATION );
+ DALI_TEST_EQUALS( gOnSceneCallBackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( gOffSceneCallBackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 0 ], TEST_LOCATION );
// test adding a child, should get onstage emitted
// clean test data
- gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
- gActorNamesOnOffStage.clear();
+ gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0;
+ gActorNamesOnOffScene.clear();
Actor child = Actor::New();
child.SetProperty( Actor::Property::NAME, "child" );
- child.OnStageSignal().Connect( OnStageCallback );
- child.OffStageSignal().Connect( OffStageCallback );
+ child.OnSceneSignal().Connect( OnSceneCallback );
+ child.OffSceneSignal().Connect( OffSceneCallback );
parent.Add( child ); // add child
- // onstage emitted, offstage not
- DALI_TEST_EQUALS( gOnStageCallBackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( gOffStageCallBackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( "child", gActorNamesOnOffStage[ 0 ], TEST_LOCATION );
+ // onscene emitted, offscene not
+ DALI_TEST_EQUALS( gOnSceneCallBackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( gOffSceneCallBackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 0 ], TEST_LOCATION );
- // test removing parent from stage
+ // test removing parent from the scene
// clean test data
- gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
- gActorNamesOnOffStage.clear();
+ gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0;
+ gActorNamesOnOffScene.clear();
- Stage::GetCurrent().Remove( parent );
- // onstage not emitted, offstage is
- DALI_TEST_EQUALS( gOnStageCallBackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gOffStageCallBackCalled, 2, TEST_LOCATION );
- DALI_TEST_EQUALS( "child", gActorNamesOnOffStage[ 0 ], TEST_LOCATION );
- DALI_TEST_EQUALS( "parent", gActorNamesOnOffStage[ 1 ], TEST_LOCATION );
+ application.GetScene().Remove( parent );
+ // onscene not emitted, offscene is
+ DALI_TEST_EQUALS( gOnSceneCallBackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( gOffSceneCallBackCalled, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 0 ], TEST_LOCATION );
+ DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 1 ], TEST_LOCATION );
- // test adding parent back to stage
+ // test adding parent back to the scene
// clean test data
- gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
- gActorNamesOnOffStage.clear();
+ gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0;
+ gActorNamesOnOffScene.clear();
- Stage::GetCurrent().Add( parent );
- // onstage emitted, offstage not
- DALI_TEST_EQUALS( gOnStageCallBackCalled, 2, TEST_LOCATION );
- DALI_TEST_EQUALS( gOffStageCallBackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( "parent", gActorNamesOnOffStage[ 0 ], TEST_LOCATION );
- DALI_TEST_EQUALS( "child", gActorNamesOnOffStage[ 1 ], TEST_LOCATION );
+ application.GetScene().Add( parent );
+ // onscene emitted, offscene not
+ DALI_TEST_EQUALS( gOnSceneCallBackCalled, 2, TEST_LOCATION );
+ DALI_TEST_EQUALS( gOffSceneCallBackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 0 ], TEST_LOCATION );
+ DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 1 ], TEST_LOCATION );
// test removing child
// clean test data
- gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
- gActorNamesOnOffStage.clear();
+ gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0;
+ gActorNamesOnOffScene.clear();
parent.Remove( child );
- // onstage not emitted, offstage is
- DALI_TEST_EQUALS( gOnStageCallBackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gOffStageCallBackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( "child", gActorNamesOnOffStage[ 0 ], TEST_LOCATION );
+ // onscene not emitted, offscene is
+ DALI_TEST_EQUALS( gOnSceneCallBackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( gOffSceneCallBackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( "child", gActorNamesOnOffScene[ 0 ], TEST_LOCATION );
// test removing parent
// clean test data
- gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
- gActorNamesOnOffStage.clear();
+ gOnSceneCallBackCalled = gOffSceneCallBackCalled = 0;
+ gActorNamesOnOffScene.clear();
- Stage::GetCurrent().Remove( parent );
- // onstage not emitted, offstage is
- DALI_TEST_EQUALS( gOnStageCallBackCalled, 0, TEST_LOCATION );
- DALI_TEST_EQUALS( gOffStageCallBackCalled, 1, TEST_LOCATION );
- DALI_TEST_EQUALS( "parent", gActorNamesOnOffStage[ 0 ], TEST_LOCATION );
+ application.GetScene().Remove( parent );
+ // onscene not emitted, offscene is
+ DALI_TEST_EQUALS( gOnSceneCallBackCalled, 0, TEST_LOCATION );
+ DALI_TEST_EQUALS( gOffSceneCallBackCalled, 1, TEST_LOCATION );
+ DALI_TEST_EQUALS( "parent", gActorNamesOnOffScene[ 0 ], TEST_LOCATION );
END_TEST;
}
Actor found = parent.FindChildById( 100000 );
DALI_TEST_CHECK( !found );
- found = parent.FindChildById( parent.GetId() );
+ found = parent.FindChildById( parent.GetProperty< int >( Actor::Property::ID ) );
DALI_TEST_CHECK( found == parent );
- found = parent.FindChildById( first.GetId() );
+ found = parent.FindChildById( first.GetProperty< int >( Actor::Property::ID ) );
DALI_TEST_CHECK( found == first );
- found = parent.FindChildById( second.GetId() );
+ found = parent.FindChildById( second.GetProperty< int >( Actor::Property::ID ) );
DALI_TEST_CHECK( found == second );
END_TEST;
}
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
ResetTouchCallbacks();
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();
DALI_TEST_CHECK( !gTouchCallBackCalled );
// connect to its touch signal
- actor.TouchedSignal().Connect(TestCallback);
+ actor.TouchSignal().Connect(TestTouchCallback);
Dali::Integration::Point point;
point.SetState( PointState::DOWN );
int UtcDaliActorSetDrawMode(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorSetDrawModeOverlay");
Actor a = Actor::New();
- Stage::GetCurrent().Add(a);
- app.SendNotification();
- app.Render(0);
- app.SendNotification();
- app.Render(1);
+ application.GetScene().Add(a);
+ application.SendNotification();
+ application.Render(0);
+ application.SendNotification();
+ application.Render(1);
DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Ensure overlay is off by default
a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
- app.SendNotification();
- app.Render(1);
+ application.SendNotification();
+ application.Render(1);
DALI_TEST_CHECK( DrawMode::OVERLAY_2D == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is overlay
a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::NORMAL );
- app.SendNotification();
- app.Render(1);
+ application.SendNotification();
+ application.Render(1);
DALI_TEST_CHECK( DrawMode::NORMAL == a.GetProperty< DrawMode::Type >( Actor::Property::DRAW_MODE ) ); // Check Actor is normal
END_TEST;
int UtcDaliActorSetDrawModeOverlayRender(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorSetDrawModeOverlayRender");
- app.SendNotification();
- app.Render(1);
+ application.SendNotification();
+ application.Render(1);
std::vector<GLuint> ids;
ids.push_back( 8 ); // first rendered actor
ids.push_back( 9 ); // second rendered actor
ids.push_back( 10 ); // third rendered actor
- app.GetGlAbstraction().SetNextTextureIds( ids );
+ application.GetGlAbstraction().SetNextTextureIds( ids );
- BufferImage imageA = BufferImage::New(16, 16);
- BufferImage imageB = BufferImage::New(16, 16);
- BufferImage imageC = BufferImage::New(16, 16);
+ Texture imageA = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
+ Texture imageB = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
+ Texture imageC = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
Actor a = CreateRenderableActor( imageA );
Actor b = CreateRenderableActor( imageB );
Actor c = CreateRenderableActor( imageC );
- app.SendNotification();
- app.Render(1);
+ application.SendNotification();
+ application.Render(1);
//Textures are bound when first created. Clear bound textures vector
- app.GetGlAbstraction().ClearBoundTextures();
+ application.GetGlAbstraction().ClearBoundTextures();
// Render a,b,c as regular non-overlays. so order will be:
// a (8)
// b (9)
// c (10)
- Stage::GetCurrent().Add(a);
- Stage::GetCurrent().Add(b);
- Stage::GetCurrent().Add(c);
+ application.GetScene().Add(a);
+ application.GetScene().Add(b);
+ application.GetScene().Add(c);
- app.SendNotification();
- app.Render(1);
+ application.SendNotification();
+ application.Render(1);
// Should be 3 textures changes.
- const std::vector<GLuint>& boundTextures = app.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
+ const std::vector<GLuint>& boundTextures = application.GetGlAbstraction().GetBoundTextures( GL_TEXTURE0 );
typedef std::vector<GLuint>::size_type TextureSize;
DALI_TEST_EQUALS( boundTextures.size(), static_cast<TextureSize>( 3 ), TEST_LOCATION );
if( boundTextures.size() == 3 )
// c (10)
// a (8)
a.SetProperty( Actor::Property::DRAW_MODE, DrawMode::OVERLAY_2D );
- app.GetGlAbstraction().ClearBoundTextures();
+ application.GetGlAbstraction().ClearBoundTextures();
- app.SendNotification();
- app.Render(1);
+ application.SendNotification();
+ application.Render(1);
// Should be 3 texture changes.
DALI_TEST_EQUALS( boundTextures.size(), static_cast<TextureSize>(3), TEST_LOCATION );
int UtcDaliActorGetCurrentWorldMatrix(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorGetCurrentWorldMatrix");
Actor parent = Actor::New();
Radian rotationAngle(Degree(85.0f));
Quaternion parentRotation(rotationAngle, Vector3::ZAXIS);
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
- parent.SetPosition( parentPosition );
+ parent.SetProperty( Actor::Property::POSITION, parentPosition );
parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
- parent.SetScale( parentScale );
- Stage::GetCurrent().Add( parent );
+ parent.SetProperty( Actor::Property::SCALE, parentScale );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
Radian childRotationAngle(Degree(23.0f));
Quaternion childRotation( childRotationAngle, Vector3::YAXIS );
Vector3 childScale( 2.0f, 2.0f, 2.0f );
- child.SetPosition( childPosition );
+ child.SetProperty( Actor::Property::POSITION, childPosition );
child.SetProperty( Actor::Property::ORIENTATION, childRotation );
- child.SetScale( childScale );
+ child.SetProperty( Actor::Property::SCALE, childScale );
parent.Add( child );
- app.SendNotification();
- app.Render(0);
- app.Render();
- app.SendNotification();
+ application.SendNotification();
+ application.Render(0);
+ application.Render();
+ application.SendNotification();
Matrix parentMatrix(false);
parentMatrix.SetTransformComponents(parentScale, parentRotation, parentPosition);
int UtcDaliActorConstrainedToWorldMatrix(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorConstrainedToWorldMatrix");
Actor parent = Actor::New();
Radian rotationAngle(Degree(85.0f));
Quaternion parentRotation(rotationAngle, Vector3::ZAXIS);
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
- parent.SetPosition( parentPosition );
+ parent.SetProperty( Actor::Property::POSITION, parentPosition );
parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
- parent.SetScale( parentScale );
- Stage::GetCurrent().Add( parent );
+ parent.SetProperty( Actor::Property::SCALE, parentScale );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
posConstraint.AddSource( Source( parent, Actor::Property::WORLD_MATRIX ) );
posConstraint.Apply();
- Stage::GetCurrent().Add( child );
+ application.GetScene().Add( child );
- app.SendNotification();
- app.Render(0);
- app.Render();
- app.SendNotification();
+ application.SendNotification();
+ application.Render(0);
+ application.Render();
+ application.SendNotification();
Matrix parentMatrix(false);
parentMatrix.SetTransformComponents(parentScale, parentRotation, parentPosition);
int UtcDaliActorConstrainedToOrientation(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorConstrainedToOrientation");
Actor parent = Actor::New();
Radian rotationAngle(Degree(85.0f));
Quaternion parentRotation(rotationAngle, Vector3::ZAXIS);
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
- parent.SetPosition( parentPosition );
+ parent.SetProperty( Actor::Property::POSITION, parentPosition );
parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
- parent.SetScale( parentScale );
- Stage::GetCurrent().Add( parent );
+ parent.SetProperty( Actor::Property::SCALE, parentScale );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
posConstraint.AddSource( Source( parent, Actor::Property::ORIENTATION ) );
posConstraint.Apply();
- Stage::GetCurrent().Add( child );
+ application.GetScene().Add( child );
- app.SendNotification();
- app.Render(0);
- app.Render();
- app.SendNotification();
+ application.SendNotification();
+ application.Render(0);
+ application.Render();
+ application.SendNotification();
DALI_TEST_EQUALS( child.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), parent.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), 0.001, TEST_LOCATION );
END_TEST;
int UtcDaliActorConstrainedToOpacity(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorConstrainedToOpacity");
Actor parent = Actor::New();
- parent.SetProperty( DevelActor::Property::OPACITY, 0.7f );
- Stage::GetCurrent().Add( parent );
+ parent.SetProperty( Actor::Property::OPACITY, 0.7f );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
- Constraint opacityConstraint = Constraint::New<float>( child, DevelActor::Property::OPACITY, EqualToConstraint() );
- opacityConstraint.AddSource( Source( parent, DevelActor::Property::OPACITY ) );
+ Constraint opacityConstraint = Constraint::New<float>( child, Actor::Property::OPACITY, EqualToConstraint() );
+ opacityConstraint.AddSource( Source( parent, Actor::Property::OPACITY ) );
opacityConstraint.Apply();
- Stage::GetCurrent().Add( child );
+ application.GetScene().Add( child );
- app.SendNotification();
- app.Render(0);
- app.Render();
- app.SendNotification();
+ application.SendNotification();
+ application.Render(0);
+ application.Render();
+ application.SendNotification();
- DALI_TEST_EQUALS( child.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), parent.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentProperty< float >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION );
- parent.SetProperty( DevelActor::Property::OPACITY, 0.3f );
+ parent.SetProperty( Actor::Property::OPACITY, 0.3f );
- app.SendNotification();
- app.Render(0);
- app.Render();
- app.SendNotification();
+ application.SendNotification();
+ application.Render(0);
+ application.Render();
+ application.SendNotification();
- DALI_TEST_EQUALS( child.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), parent.GetCurrentProperty< float >( DevelActor::Property::OPACITY ), 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentProperty< float >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION );
END_TEST;
}
int UtcDaliActorUnparent(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorUnparent");
Actor parent = Actor::New();
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
int UtcDaliActorGetChildAt(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorGetChildAt");
Actor parent = Actor::New();
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child0 = Actor::New();
parent.Add( child0 );
int UtcDaliActorSetGetOverlay(void)
{
- TestApplication app;
+ TestApplication application;
tet_infoline(" UtcDaliActorSetGetOverlay");
Actor parent = Actor::New();
{ "maximumSize", Actor::Property::MAXIMUM_SIZE, Property::VECTOR2 },
{ "inheritPosition", Actor::Property::INHERIT_POSITION, Property::BOOLEAN },
{ "clippingMode", Actor::Property::CLIPPING_MODE, Property::STRING },
- { "opacity", DevelActor::Property::OPACITY, Property::FLOAT },
+ { "opacity", Actor::Property::OPACITY, Property::FLOAT },
};
const unsigned int PROPERTY_TABLE_COUNT = sizeof( PROPERTY_TABLE ) / sizeof( PROPERTY_TABLE[0] );
} // unnamed namespace
int UtcDaliActorProperties(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliRelayoutProperties_ResizePolicies(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliRelayoutProperties_SizeScalePolicy(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliRelayoutProperties_SizeModeFactor(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliRelayoutProperties_DimensionDependency(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliRelayoutProperties_Padding(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliRelayoutProperties_MinimumMaximumSize(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliActorGetHeightForWidth(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliActorGetWidthForHeight(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliActorGetRelayoutSize(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
// Add actor to stage
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
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();
- app.Render();
+ application.SendNotification();
+ application.Render();
DALI_TEST_EQUALS( actor.GetRelayoutSize( Dimension::WIDTH ), 1.0f, TEST_LOCATION );
int UtcDaliActorSetPadding(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliActorSetMinimumSize(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
int UtcDaliActorSetMaximumSize(void)
{
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
DALI_TEST_CHECK( ! gOnRelayoutCallBackCalled );
// Add actor to stage
- Stage::GetCurrent().Add( actor );
+ application.GetScene().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();
*
* GetHierarchyDepth should return 1 for A, 2 for B and C, and 3 for D, E and F.
*/
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
Actor actorB = Actor::New();
Actor actorF = Actor::New();
//Test that root actor has depth equal 0
- DALI_TEST_EQUALS( 0, stage.GetRootLayer().GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0, stage.GetRootLayer().GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Test actors return depth -1 when not connected to the tree
- DALI_TEST_EQUALS( -1, actorA.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorC.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorE.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorF.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Create the hierarchy
stage.Add( actorA );
actorC.Add( actorF );
//Test actors return correct depth
- DALI_TEST_EQUALS( 1, actorA.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 2, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 2, actorC.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 3, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 3, actorE.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( 3, actorF.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 2, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 2, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 3, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 3, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 3, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Removing actorB from the hierarchy. actorB, actorD and actorE should now have depth equal -1
actorA.Remove( actorB );
- DALI_TEST_EQUALS( -1, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorE.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
//Removing actorA from the stage. All actors should have depth equal -1
stage.Remove( actorA );
- DALI_TEST_EQUALS( -1, actorA.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorB.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorC.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorD.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorE.GetHierarchyDepth(), TEST_LOCATION );
- DALI_TEST_EQUALS( -1, actorF.GetHierarchyDepth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorA.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorB.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorC.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorD.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorE.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
+ DALI_TEST_EQUALS( -1, actorF.GetProperty< int >( Actor::Property::HIERARCHY_DEPTH ), TEST_LOCATION );
END_TEST;
}
END_TEST;
}
-int UtcDaliActorAddRendererN(void)
+int UtcDaliActorAddRendererN01(void)
{
tet_infoline("Testing Actor::AddRenderer");
TestApplication application;
END_TEST;
}
-int UtcDaliActorAddRendererOnStage(void)
+int UtcDaliActorAddRendererN02(void)
+{
+ tet_infoline( "UtcDaliActorAddRendererN02" );
+
+ Actor actor;
+ Renderer renderer;
+
+ {
+ TestApplication application;
+
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = CreateShader();
+ renderer = Renderer::New( geometry, shader );
+
+ actor = Actor::New();
+ }
+
+ // try illegal AddRenderer
+ try
+ {
+ actor.AddRenderer( renderer );
+ tet_printf( "Assertion test failed - no Exception\n" );
+ tet_result( TET_FAIL );
+ }
+ catch( Dali::DaliException& e )
+ {
+ DALI_TEST_PRINT_ASSERT( e );
+ DALI_TEST_ASSERT( e, "EventThreadServices::IsCoreRunning()", TEST_LOCATION );
+ }
+ catch(...)
+ {
+ tet_printf( "Assertion test failed - wrong Exception\n" );
+ tet_result( TET_FAIL );
+ }
+
+ END_TEST;
+}
+
+int UtcDaliActorAddRendererOnScene(void)
{
tet_infoline("Testing Actor::AddRenderer");
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
// Clipping test helper functions:
Actor CreateActorWithContent( uint32_t width, uint32_t height)
{
- BufferImage image = BufferImage::New( width, height );
+ Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
Actor actor = CreateRenderableActor( image );
// 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 );
// Create a clipping actor.
Actor actorDepth1Clip = CreateActorWithContent16x16();
actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- Stage::GetCurrent().Add( actorDepth1Clip );
+ application.GetScene().Add( actorDepth1Clip );
// Gather the call trace.
GenerateTrace( application, enabledDisableTrace, stencilTrace );
// Create a clipping actor.
Actor actorDepth1Clip = CreateActorWithContent16x16();
actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- Stage::GetCurrent().Add( actorDepth1Clip );
+ application.GetScene().Add( actorDepth1Clip );
// Gather the call trace.
GenerateTrace( application, enabledDisableTrace, stencilTrace );
// Create a clipping actor.
Actor actorDepth1Clip = CreateActorWithContent16x16();
actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- Stage::GetCurrent().Add( actorDepth1Clip );
+ application.GetScene().Add( actorDepth1Clip );
// Create a child actor.
Actor childDepth2 = CreateActorWithContent16x16();
// If we are on the first loop, set the layer to 3D and loop to perform the test again.
if( i == 0u )
{
- Stage::GetCurrent().GetRootLayer().SetBehavior( Layer::LAYER_3D );
+ application.GetScene().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
GenerateTrace( application, enabledDisableTrace, stencilTrace );
}
}
Actor actors[5];
for( int i = 0; i < 5; ++i )
{
- BufferImage image = BufferImage::New( 16u, 16u );
+ Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 16u, 16u );
Actor actor = CreateRenderableActor( image );
// 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 )
{
actors[1].SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
// Build the scene graph.
- Stage::GetCurrent().Add( actors[0] );
+ application.GetScene().Add( actors[0] );
// Left branch:
actors[0].Add( actors[1] );
clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_LEFT );
clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX );
- Stage::GetCurrent().Add( clippingActorA );
+ application.GetScene().Add( clippingActorA );
// Gather the call trace.
GenerateTrace( application, enabledDisableTrace, scissorTrace );
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 );
+ application.GetScene().Add( clippingActorA );
+ application.GetScene().Add( clippingActorB );
// Gather the call trace.
GenerateTrace( application, enabledDisableTrace, scissorTrace );
clippingActorA.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
clippingActorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
clippingActorA.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_TO_BOUNDING_BOX );
- Stage::GetCurrent().Add( clippingActorA );
+ application.GetScene().Add( clippingActorA );
// Create a child clipping actor.
Actor clippingActorB = CreateActorWithContent16x16();
{
// 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 );
+ application.GetScene().Add( clippingActorA );
clippingActorA.Add( clippingActorB );
- Stage::GetCurrent().Add( clippingActorC );
- Stage::GetCurrent().Add( clippingActorD );
+ application.GetScene().Add( clippingActorC );
+ application.GetScene().Add( clippingActorD );
clippingActorD.Add( clippingActorE );
// Gather the call trace.
// Create a clipping actor.
Actor actorDepth1Clip = CreateActorWithContent16x16();
actorDepth1Clip.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- Stage::GetCurrent().Add( actorDepth1Clip );
+ application.GetScene().Add( actorDepth1Clip );
// Turn the RenderMode to just "COLOR" at the Renderer level to ignore the clippingMode.
actorDepth1Clip.GetRendererAt( 0 ).SetProperty( Renderer::Property::RENDER_MODE, RenderMode::COLOR );
int UtcDaliGetPropertyN(void)
{
tet_infoline( "Testing Actor::GetProperty returns a non valid value if property index is out of range" );
- TestApplication app;
+ TestApplication application;
Actor actor = Actor::New();
Debug::Filter::SetGlobalLogLevel( Debug::Verbose );
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
Actor actorB = Actor::New();
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
Actor actorB = Actor::New();
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
Actor actorB = Actor::New();
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
// Set up renderers to add to Actors, float value 1, 2, 3 assigned to each
// enables checking of which actor the uniform is assigned too
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor parentA = Actor::New();
Actor parentB = Actor::New();
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
Actor actorB = Actor::New();
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
Actor actorB = Actor::New();
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
Actor actorB = Actor::New();
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
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" );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position %f %f \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorScreenPosition.x, actorScreenPosition.y );
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();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT Position x=30 y = 0.0 \n", actorScreenPosition.x, actorScreenPosition.y );
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();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
DALI_TEST_EQUALS( actorScreenPosition.x, 30lu , TEST_LOCATION );
DALI_TEST_EQUALS( actorScreenPosition.y, 420lu , TEST_LOCATION );
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();
- actorScreenPosition = actorB.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
DALI_TEST_EQUALS( actorScreenPosition.x, 50lu , TEST_LOCATION );
DALI_TEST_EQUALS( actorScreenPosition.y, 50lu , TEST_LOCATION );
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
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" );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
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" );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_RIGHT ParentOrigin::TOP_RIGHT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
tet_infoline( "Create Child Actor 1 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" );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
application.Render();
actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::BOTTOM_LEFT ParentOrigin::TOP_LEFT \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
tet_infoline( "Create Child Actor 1 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( "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" );
application.Render();
Vector3 actorWorldPosition = actorA.GetProperty( Actor::Property::WORLD_POSITION ).Get< Vector3 >();
- Vector2 actorScreenPosition = actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >();
+ Vector2 actorScreenPosition = actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >();
tet_printf( "Actor World Position ( %f %f ) AnchorPoint::TOP_LEFT ParentOrigin::CENTER \n", actorWorldPosition.x, actorWorldPosition.y );
tet_printf( "Actor Screen Position ( %f %f ) \n", actorScreenPosition.x, actorScreenPosition.y );
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
tet_infoline( "Create an actor with AnchorPoint::TOP_LEFT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" );
Actor actorA = Actor::New();
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::POSITION_USES_ANCHOR_POINT, false );
+ actorA.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 20.0f ) );
stage.Add( actorA );
tet_infoline( "Create an Actor with AnchorPoint::BOTTOM_RIGHT, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" );
Actor actorB = Actor::New();
actorB.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_RIGHT );
actorB.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- actorB.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actorB.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
Vector2 actorBSize( 30.0f, 60.0f );
- actorB.SetSize( actorBSize );
+ actorB.SetProperty( Actor::Property::SIZE, actorBSize );
stage.Add( actorB );
tet_infoline( "Create an actor with AnchorPoint::CENTER, ParentOrigin::CENTER and 0,0 position, POSITION_USES_ANCHOR false" );
Actor actorC = Actor::New();
actorC.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
actorC.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- actorC.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actorC.SetProperty( Actor::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();
Vector2 center( stage.GetSize() * 0.5f );
- DALI_TEST_EQUALS( actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
- DALI_TEST_EQUALS( actorB.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
- DALI_TEST_EQUALS( actorC.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorC.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center, TEST_LOCATION );
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();
- DALI_TEST_EQUALS( actorA.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center /* TOP_LEFT Anchor */, TEST_LOCATION );
- DALI_TEST_EQUALS( actorB.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorBSize /* BOTTOM_RIGHT Anchor */, TEST_LOCATION );
- DALI_TEST_EQUALS( actorC.GetProperty( DevelActor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorCSize * 0.5f /* CENTER Anchor*/, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorA.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center /* TOP_LEFT Anchor */, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorB.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorBSize /* BOTTOM_RIGHT Anchor */, TEST_LOCATION );
+ DALI_TEST_EQUALS( actorC.GetProperty( Actor::Property::SCREEN_POSITION).Get< Vector2 >(), center - actorCSize * 0.5f /* CENTER Anchor*/, TEST_LOCATION );
END_TEST;
}
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 );
- Stage::GetCurrent().Add( actor );
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::WORLD_POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), TEST_LOCATION );
tet_infoline( "Set the position uses anchor point property to false\n" );
- actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
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.SetScale( 2.0f );
- actor.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false );
- Stage::GetCurrent().Add( actor );
+ actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
+ actor.SetProperty( Actor::Property::SCALE, 2.0f );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
+ application.GetScene().Add( actor );
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 ) );
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::POSITION_USES_ANCHOR_POINT, false );
+ application.GetScene().Add( actor );
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 ) );
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 );
+ actor.SetProperty( Actor::Property::SCALE, 2.0f );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Actor parent = Actor::New();
- Stage::GetCurrent().Add( parent );
- Vector2 stageSize( Stage::GetCurrent().GetSize() );
+ application.GetScene().Add( parent );
+ Vector2 stageSize( application.GetScene().GetSize() );
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 );
+ actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
parent.Add( actor );
application.SendNotification();
tet_infoline( "Check that the visibility change signal is emitted when the visibility changes when an animation starts" );
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Actor actor0 = Actor::New();
DALI_TEST_EQUALS( actor0.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
- Stage::GetCurrent().Add( actor0 );
+ application.GetScene().Add( actor0 );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor1.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
DALI_TEST_EQUALS( actor2.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
- Stage::GetCurrent().Add( actor3 );
+ application.GetScene().Add( actor3 );
actor3.Add( actor4 );
actor4.Add( actor5 );
actor5.Add( actor6 );
Actor actor = Actor::New();
DALI_TEST_EQUALS( actor.GetProperty< int >( Actor::Property::LAYOUT_DIRECTION ), static_cast< int >( LayoutDirection::LEFT_TO_RIGHT ), TEST_LOCATION );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
bool signalCalled = false;
LayoutDirectionFunctor layoutDirectionFunctor(signalCalled);
int UtcDaliChildAddedSignalP1(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
bool signalReceived=false;
Actor childActor;
int UtcDaliChildAddedSignalP2(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
bool signalReceived=false;
Actor childActor;
int UtcDaliChildAddedSignalN(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
bool signalReceived=false;
Actor childActor;
int UtcDaliChildRemovedSignalP1(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
bool signalReceived=false;
Actor childActor;
int UtcDaliChildRemovedSignalP2(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
bool signalReceived=false;
Actor childActor;
int UtcDaliChildRemovedSignalN(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
bool signalReceived=false;
Actor childActor;
int UtcDaliChildMovedSignalP(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
bool addedASignalReceived = false;
bool removedASignalReceived = false;
int utcDaliActorCulled(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
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();
application.SendNotification();
application.Render( 0 );
- DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::CULLED ), false, TEST_LOCATION );
- PropertyNotification notification = actor.AddPropertyNotification( DevelActor::Property::CULLED, LessThanCondition( 0.5f ) );
- notification.SetNotifyMode( PropertyNotification::NotifyOnChanged );
+ PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::CULLED, LessThanCondition( 0.5f ) );
+ notification.SetNotifyMode( PropertyNotification::NOTIFY_ON_CHANGED );
// Connect NotifySignal
bool propertyNotificationSignal( false );
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();
application.SendNotification();
- DALI_TEST_EQUALS( actor.GetProperty< bool >( DevelActor::Property::CULLED ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty< bool >( Actor::Property::CULLED ), true, TEST_LOCATION );
DALI_TEST_EQUALS( propertyNotificationSignal, true, TEST_LOCATION );
- DALI_TEST_EQUALS( source.GetTargetProperty(), static_cast< int >( DevelActor::Property::CULLED ), TEST_LOCATION );
+ DALI_TEST_EQUALS( source.GetTargetProperty(), static_cast< int >( Actor::Property::CULLED ), TEST_LOCATION );
DALI_TEST_EQUALS( source.GetTarget().GetProperty< bool >( source.GetTargetProperty() ), true, TEST_LOCATION );
END_TEST;
int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
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();
int utcDaliEnsureRenderWhenMakingLastActorInvisible(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto stage = application.GetScene();
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 );
+ application.GetScene().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 );
- Vector3 targetValue( 10.0f, 20.0f, 30.0f );
+ // Set size again
+ actorSize = Vector3( 200.0f, 200.0f, 0.0f );
+ actor.SetProperty( Actor::Property::SIZE, actorSize );
+
+ size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >();
+ DALI_TEST_EQUALS( size, actorSize, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+
+ Vector3 targetValue( 10.0f, 20.0f, 0.0f );
Animation animation = Animation::New( 1.0f );
animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetValue );
animation.Play();
+ // Size should be updated without rendering.
+ size = actor.GetProperty( Actor::Property::SIZE ).Get< Vector3 >();
+ DALI_TEST_EQUALS( size, targetValue, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+
application.SendNotification();
application.Render( 1100 ); // After the animation
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;
+}
+
+int utcDaliActorPartialUpdate(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline("Check the damaged area");
+
+ const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() );
+
+ std::vector<Rect<int>> damagedRects;
+ Rect<int> clippingRect;
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ // First render pass, nothing to render, adaptor would just do swap buffer.
+ DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ Actor actor = CreateRenderableActor();
+ actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+ actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+ actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(actor);
+
+ application.SendNotification();
+
+ // 1. Actor added, damaged rect is added size of actor
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ clippingRect = Rect<int>(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ // 2. Set new size
+ actor.SetProperty(Actor::Property::SIZE, Vector3(32.0f, 32.0f, 0));
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ clippingRect = Rect<int>(16, 752, 48, 48); // in screen coordinates, includes 3 last frames updates
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ // 3. Set new position
+ actor.SetProperty(Actor::Property::POSITION, Vector3(32.0f, 32.0f, 0));
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ clippingRect = Rect<int>(16, 736, 64, 64); // in screen coordinates, includes 3 last frames updates
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ application.GetScene().Remove(actor);
+ application.SendNotification();
+
+ // Actor removed, last 3 dirty rects are reported. Adaptor would merge them together.
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 3, TEST_LOCATION);
+
+ clippingRect = damagedRects[0];
+ clippingRect.Merge(damagedRects[1]);
+ clippingRect.Merge(damagedRects[2]);
+
+ DALI_TEST_EQUALS(clippingRect.IsEmpty(), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.IsValid(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, Rect<int>(16, 736, 64, 64), TEST_LOCATION);
+
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int utcDaliActorPartialUpdateSetColor(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline("Check uniform update");
+
+ const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() );
+
+ std::vector<Rect<int>> damagedRects;
+ Rect<int> clippingRect;
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ // First render pass, nothing to render, adaptor would just do swap buffer.
+ DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ Actor actor = CreateRenderableActor();
+ actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+ actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+ actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(actor);
+
+ application.SendNotification();
+
+ // 1. Actor added, damaged rect is added size of actor
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ clippingRect = Rect<int>(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ // 2. Set new color
+ actor.SetProperty(Actor::Property::COLOR, Vector3(1.0f, 0.0f, 0.0f));
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ clippingRect = Rect<int>(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ END_TEST;
+}
+
+const std::string SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME("uLightCameraProjectionMatrix");
+const std::string SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME("uLightCameraViewMatrix");
+const std::string SHADER_SHADOW_COLOR_PROPERTY_NAME("uShadowColor");
+const char* const RENDER_SHADOW_VERTEX_SOURCE =
+ " uniform mediump mat4 uLightCameraProjectionMatrix;\n"
+ " uniform mediump mat4 uLightCameraViewMatrix;\n"
+ "\n"
+ "void main()\n"
+ "{\n"
+ " gl_Position = uProjection * uModelView * vec4(aPosition,1.0);\n"
+ " vec4 textureCoords = uLightCameraProjectionMatrix * uLightCameraViewMatrix * uModelMatrix * vec4(aPosition,1.0);\n"
+ " vTexCoord = 0.5 + 0.5 * (textureCoords.xy/textureCoords.w);\n"
+ "}\n";
+
+const char* const RENDER_SHADOW_FRAGMENT_SOURCE =
+ "uniform lowp vec4 uShadowColor;\n"
+ "void main()\n"
+ "{\n"
+ " lowp float alpha;\n"
+ " alpha = texture2D(sTexture, vec2(vTexCoord.x, vTexCoord.y)).a;\n"
+ " gl_FragColor = vec4(uShadowColor.rgb, uShadowColor.a * alpha);\n"
+ "}\n";
+
+int utcDaliActorPartialUpdateSetProperty(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline( "Set/Update property with partial update" );
+
+ const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+ std::vector<Rect<int>> damagedRects;
+ Rect<int> clippingRect;
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ // First render pass, nothing to render, adaptor would just do swap buffer.
+ DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ Texture image = Texture::New(TextureType::TEXTURE_2D, Pixel::RGBA8888, 4u, 4u);
+ Actor actor = CreateRenderableActor(image, RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE);
+ actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+ actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+ actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(actor);
+
+ actor.RegisterProperty(SHADER_SHADOW_COLOR_PROPERTY_NAME, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+
+ damagedRects.clear();
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ clippingRect = Rect<int>(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ Property::Index shadowColorPropertyIndex = actor.GetPropertyIndex( SHADER_SHADOW_COLOR_PROPERTY_NAME );
+ actor.SetProperty(shadowColorPropertyIndex, Vector4(1.0f, 1.0f, 0.0f, 1.0f));
+
+ damagedRects.clear();
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int utcDaliActorPartialUpdateTwoActors(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline("Check the damaged rects with partial update and two actors");
+
+ const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() );
+
+ Actor actor = CreateRenderableActor();
+ actor.SetProperty(Actor::Property::POSITION, Vector3(100.0f, 100.0f, 0.0f));
+ actor.SetProperty(Actor::Property::SIZE, Vector3(50.0f, 50.0f, 0.0f));
+ actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(actor);
+
+ Actor actor2 = CreateRenderableActor();
+ actor2.SetProperty(Actor::Property::POSITION, Vector3(150.0f, 150.0f, 0.0f));
+ actor2.SetProperty(Actor::Property::SIZE, Vector3(100.0f, 100.0f, 0.0f));
+ actor2.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(actor2);
+
+ application.SendNotification();
+ std::vector<Rect<int>> damagedRects;
+ application.PreRenderWithPartialUpdate(TestApplication::DEFAULT_RENDER_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 2, TEST_LOCATION);
+ DALI_TEST_EQUALS<Rect<int>>(Rect<int>(64, 672, 64, 64), damagedRects[0], TEST_LOCATION);
+ DALI_TEST_EQUALS<Rect<int>>(Rect<int>(96, 592, 112, 112), damagedRects[1], TEST_LOCATION);
+
+ // in screen coordinates, adaptor would calculate it using previous frames information
+ Rect<int> clippingRect = Rect<int>(64, 592, 144, 192);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int utcDaliActorPartialUpdateActorsWithSizeHint(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline( "Check the damaged rect with partial update and actor size hint" );
+
+ const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() );
+
+ Actor actor = CreateRenderableActor();
+ actor.SetProperty(Actor::Property::POSITION, Vector3(75.0f, 150.0f, 0.0f));
+ actor.SetProperty(Actor::Property::SIZE, Vector3(75.0f, 150.0f, 0.0f));
+ actor.SetProperty(DevelActor::Property::UPDATE_SIZE_HINT, Vector3(150, 300, 0));
+ actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+ application.GetScene().Add(actor);
+
+ application.SendNotification();
+ std::vector<Rect<int>> damagedRects;
+ application.PreRenderWithPartialUpdate(TestApplication::DEFAULT_RENDER_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ Rect<int> clippingRect = Rect<int>(0, 496, 160, 320);
+ DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+ DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int UtcDaliActorCaptureAllTouchAfterStartPropertyP(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get<bool>(), false, TEST_LOCATION);
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, true);
+ DALI_TEST_EQUALS(actor.GetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START).Get<bool>(), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.GetPropertyType(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), Property::BOOLEAN, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsPropertyWritable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), true, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsPropertyAnimatable(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.IsPropertyAConstraintInput(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), false, TEST_LOCATION);
+ DALI_TEST_EQUALS(actor.GetPropertyName(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START), "captureAllTouchAfterStart", TEST_LOCATION);
+ END_TEST;
+}
+
+int UtcDaliActorCaptureAllTouchAfterStartPropertyN(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+
+ // Make sure setting invalid types does not cause a crash
+ try
+ {
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, 1.0f);
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector2::ONE);
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector3::ONE);
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Vector4::ONE);
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Map());
+ actor.SetProperty(DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START, Property::Array());
+ tet_result(TET_PASS);
+ }
+ catch(...)
+ {
+ tet_result(TET_FAIL);
+ }
+ END_TEST;
+}
+
+int UtcDaliActorLowerBelowNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Actor arg1;
+ instance.LowerBelow(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRaiseAboveNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Actor arg1;
+ instance.RaiseAbove(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRaiseToTopNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.RaiseToTop();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorAddRendererNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Renderer arg1;
+ instance.AddRenderer(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorTouchSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.TouchSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorTranslateByNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Vector3 arg1;
+ instance.TranslateBy(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorFindChildByIdNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ unsigned int arg1 = 0u;
+ instance.FindChildById(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetRendererAtNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ unsigned int arg1 = 0u;
+ instance.GetRendererAt(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorHoveredSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.HoveredSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorLowerToBottomNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.LowerToBottom();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorOnSceneSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.OnSceneSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorOffSceneSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.OffSceneSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRemoveRendererNegative01(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ unsigned int arg1 = 0u;
+ instance.RemoveRenderer(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRemoveRendererNegative02(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Renderer arg1;
+ instance.RemoveRenderer(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorFindChildByNameNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ std::string arg1;
+ instance.FindChildByName(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorSetResizePolicyNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::ResizePolicy::Type arg1 = ResizePolicy::USE_NATURAL_SIZE;
+ Dali::Dimension::Type arg2 = Dimension::ALL_DIMENSIONS;
+ instance.SetResizePolicy(arg1,arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorOnRelayoutSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.OnRelayoutSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorWheelEventSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.WheelEventSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetHeightForWidthNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ float arg1 = 0.0f;
+ instance.GetHeightForWidth(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetWidthForHeightNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ float arg1 = 0.0f;
+ instance.GetWidthForHeight(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorLayoutDirectionChangedSignalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.LayoutDirectionChangedSignal();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorAddNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Actor arg1;
+ instance.Add(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorLowerNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.Lower();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRaiseNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.Raise();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRemoveNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Actor arg1;
+ instance.Remove(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorScaleByNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Vector3 arg1;
+ instance.ScaleBy(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetLayerNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.GetLayer();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRotateByNegative01(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Quaternion arg1;
+ instance.RotateBy(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorRotateByNegative02(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Radian arg1;
+ Dali::Vector3 arg2;
+ instance.RotateBy(arg1,arg2);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorUnparentNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.Unparent();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetChildAtNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ unsigned int arg1 = 0u;
+ instance.GetChildAt(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetChildCountNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.GetChildCount();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetTargetSizeNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.GetTargetSize();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorScreenToLocalNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ float arg1 = 0.0f;
+ float arg2 = 0.0f;
+ float arg3 = 0.0f;
+ float arg4 = 0.0f;
+ instance.ScreenToLocal(arg1,arg2,arg3,arg4);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetNaturalSizeNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.GetNaturalSize();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetRelayoutSizeNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Dimension::Type arg1 = Dimension::HEIGHT;
+ instance.GetRelayoutSize(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetResizePolicyNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ Dali::Dimension::Type arg1 = Dimension::ALL_DIMENSIONS;
+ instance.GetResizePolicy(arg1);
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetRendererCountNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.GetRendererCount();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
+ END_TEST;
+}
+
+int UtcDaliActorGetParentNegative(void)
+{
+ TestApplication application;
+ Dali::Actor instance;
+ try
+ {
+ instance.GetParent();
+ DALI_TEST_CHECK(false); // Should not get here
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // We expect an assert
+ }
END_TEST;
}