/*
- * 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.
{
TestApplication application;
- auto stage = Stage::GetCurrent();
+ auto scene = application.GetScene();
auto actor = Actor::New();
auto& actorImpl = GetImplementation( actor );
actorObserver.SetActor( &actorImpl );
DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
- stage.Add( actor );
+ scene.Add( actor );
DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
- // Removing the actor from the stage should make it return null
- stage.Remove( actor );
+ // Removing the actor from the scene should make it return null
+ scene.Remove( actor );
DALI_TEST_EQUALS( actorObserver.GetActor(), nullptr, TEST_LOCATION );
// Adding the actor back to the scene should mean it returning the actor again
- stage.Add( actor );
+ scene.Add( actor );
DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
// Resetting the actor should return nullptr
actorObserver.SetActor( &actorImpl );
DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
- // Create another Actor and observe that (don't add it to the stage just yet)
+ // Create another Actor and observe that (don't add it to the scene just yet)
{
auto actor2 = Actor::New();
auto& actor2Impl = GetImplementation( actor2 );
// Test to ensure the passed in callback is called when the observed actor is disconnected
TestCallback::Reset();
- auto stage = Stage::GetCurrent();
+ auto scene = application.GetScene();
auto actor = Actor::New();
auto& actorImpl = GetImplementation( actor );
- stage.Add( actor );
+ scene.Add( actor );
ActorObserver actorObserver( MakeCallback( &TestCallback::Function ) );
actorObserver.SetActor( &actorImpl );
DALI_TEST_EQUALS( actorObserver.GetActor(), &actorImpl, TEST_LOCATION );
DALI_TEST_EQUALS( TestCallback::disconnectedActor, nullptr, TEST_LOCATION );
- // Unstage Actor
+ // Remove Actor from scene
actor.Unparent();
DALI_TEST_EQUALS( actorObserver.GetActor(), nullptr, TEST_LOCATION );
DALI_TEST_EQUALS( TestCallback::disconnectedActor, &actorImpl, TEST_LOCATION );
try
{
- auto stage = Stage::GetCurrent();
+ auto scene = application.GetScene();
auto actor = Actor::New();
auto& actorImpl = GetImplementation( actor );
- stage.Add( actor );
+ scene.Add( actor );
ActorObserver *observer1 = new ActorObserver( MakeCallback( &TestCallback::Function ) );
observer1->SetActor( &actorImpl );
// Move observer1 into a new observer
ActorObserver* observer2 = new ActorObserver( std::move( *observer1 ) );
- // Unstage Actor, function should be called only once
+ // Remove actor from scene, function should be called only once
actor.Unparent();
DALI_TEST_EQUALS( TestCallback::disconnectedActor, &actorImpl, TEST_LOCATION );
DALI_TEST_EQUALS( TestCallback::callCount, 1, TEST_LOCATION );
/*
- * Copyright (c) 2016 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.
actor.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
actor.SetProperty( Actor::Property::SIZE, size );
actor.SetProperty( Actor::Property::POSITION, position );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
RelayoutSignalHandler relayoutSignal( application );
actor.OnRelayoutSignal().Connect( &relayoutSignal, &RelayoutSignalHandler::RelayoutCallback );
}
);
-Actor CreateMeshActorToStage( TestApplication& application, Vector3 parentOrigin = ParentOrigin::CENTER, Vector3 anchorPoint = AnchorPoint::CENTER, Shader::Hint::Value shaderHints = Shader::Hint::NONE )
+Actor CreateMeshActorToScene( TestApplication& application, Vector3 parentOrigin = ParentOrigin::CENTER, Vector3 anchorPoint = AnchorPoint::CENTER, Shader::Hint::Value shaderHints = Shader::Hint::NONE )
{
Integration::PixelBuffer* pixelBuffer = new Integration::PixelBuffer[ 4 ];
PixelData pixelData = PixelData::New(pixelBuffer, 4, 1, 1, Pixel::RGBA8888, PixelData::DELETE_ARRAY);
meshActor.SetProperty( Actor::Property::SIZE, Vector3( 400.0f, 400.0f, 0.1f ) );
meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, parentOrigin );
meshActor.SetProperty( Actor::Property::ANCHOR_POINT, anchorPoint );
- Stage::GetCurrent().Add( meshActor );
+ application.GetScene().Add( meshActor );
application.SendNotification();
application.Render( 16 );
bool GetCameraDepths( TestApplication& application, float& nearPlane, float& farPlane, float& cameraDepth )
{
- RenderTaskList renderTasks = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList renderTasks = application.GetScene().GetRenderTaskList();
CameraActor cameraActor;
for( unsigned int i = 0; i < renderTasks.GetTaskCount(); ++i )
{
TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
drawTrace.Enable( true );
- CreateMeshActorToStage( application );
+ CreateMeshActorToScene( application );
drawTrace.Reset();
application.SendNotification();
drawTrace.Enable( true );
float offset = -0.01f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_RIGHT );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_RIGHT );
float radius = meshActor.GetTargetSize().Length() * 0.5f;
- Vector2 stageSize = Stage::GetCurrent().GetSize();
- meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( -radius / stageSize.width + offset, 0.5f, 0.5f ) );
+ Vector2 sceneSize = application.GetScene().GetSize();
+ meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( -radius / sceneSize.width + offset, 0.5f, 0.5f ) );
meshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
drawTrace.Reset();
drawTrace.Enable( true );
float offset = 0.01f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_RIGHT );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_RIGHT );
drawTrace.Reset();
application.SendNotification();
drawTrace.Enable( true );
float offset = 1.01f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_LEFT );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_LEFT );
float radius = meshActor.GetTargetSize().Length() * 0.5f;
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 sceneSize = application.GetScene().GetSize();
- meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( radius / stageSize.width + offset, 0.5f, 0.5f ) );
+ meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( radius / sceneSize.width + offset, 0.5f, 0.5f ) );
meshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
drawTrace.Reset();
drawTrace.Enable( true );
float offset = 0.99f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_LEFT );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( offset, 0.5f, 0.5f ), AnchorPoint::CENTER_LEFT );
drawTrace.Reset();
application.SendNotification();
drawTrace.Enable( true );
float offset = -0.01f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::BOTTOM_CENTER );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::BOTTOM_CENTER );
float radius = meshActor.GetTargetSize().Length() * 0.5f;
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 sceneSize = application.GetScene().GetSize();
- meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, -radius / stageSize.width + offset, 0.5f ) );
+ meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, -radius / sceneSize.width + offset, 0.5f ) );
meshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
drawTrace.Reset();
drawTrace.Enable( true );
float offset = 0.01f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::BOTTOM_CENTER );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::BOTTOM_CENTER );
drawTrace.Reset();
application.SendNotification();
drawTrace.Enable( true );
float offset = 1.01f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::TOP_CENTER );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::TOP_CENTER );
float radius = meshActor.GetTargetSize().Length() * 0.5f;
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 sceneSize = application.GetScene().GetSize();
- meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, radius / stageSize.width + offset, 0.5f ) );
+ meshActor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, radius / sceneSize.width + offset, 0.5f ) );
meshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
drawTrace.Reset();
drawTrace.Enable( true );
float offset = 0.99f;
- Actor meshActor = CreateMeshActorToStage( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::TOP_CENTER );
+ Actor meshActor = CreateMeshActorToScene( application, Vector3( 0.5f, offset, 0.5f ), AnchorPoint::TOP_CENTER );
drawTrace.Reset();
application.SendNotification();
float nearPlane, farPlane, cameraDepth;
DALI_TEST_CHECK( GetCameraDepths( application, nearPlane, farPlane, cameraDepth ) );
- Actor meshActor = CreateMeshActorToStage( application );
+ Actor meshActor = CreateMeshActorToScene( application );
Vector3 meshPosition = meshActor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
float radius = meshActor.GetTargetSize().Length() * 0.5f;
float nearPlane, farPlane, cameraDepth;
DALI_TEST_CHECK( GetCameraDepths( application, nearPlane, farPlane, cameraDepth ) );
- Actor meshActor = CreateMeshActorToStage( application );
+ Actor meshActor = CreateMeshActorToScene( application );
Vector3 meshPosition = meshActor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
float offset = meshActor.GetTargetSize().z - 0.1f;
float nearPlane, farPlane, cameraDepth;
DALI_TEST_CHECK( GetCameraDepths( application, nearPlane, farPlane, cameraDepth ) );
- Actor meshActor = CreateMeshActorToStage( application );
+ Actor meshActor = CreateMeshActorToScene( application );
Vector3 meshPosition = meshActor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
float radius = meshActor.GetTargetSize().Length() * 0.5f;
float nearPlane, farPlane, cameraDepth;
DALI_TEST_CHECK( GetCameraDepths( application, nearPlane, farPlane, cameraDepth ) );
- Actor meshActor = CreateMeshActorToStage( application );
+ Actor meshActor = CreateMeshActorToScene( application );
Vector3 meshPosition = meshActor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION );
float offset = meshActor.GetTargetSize().z - 0.1f;
TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
drawTrace.Enable( true );
- CreateMeshActorToStage( application, Vector3( 7.0f, 0.5f, 0.5f ), AnchorPoint::CENTER, Shader::Hint::MODIFIES_GEOMETRY );
+ CreateMeshActorToScene( application, Vector3( 7.0f, 0.5f, 0.5f ), AnchorPoint::CENTER, Shader::Hint::MODIFIES_GEOMETRY );
drawTrace.Reset();
application.SendNotification();
DALI_TEST_CHECK(!actor.GetProperty< bool >( Actor::Property::IS_ROOT ));
// get the root layer
- actor = Stage::GetCurrent().GetLayer( 0 );
+ actor = application.GetScene().GetLayer( 0 );
DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::IS_ROOT ) );
END_TEST;
}
DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
// get the root layer
- actor = Stage::GetCurrent().GetLayer( 0 );
+ actor = application.GetScene().GetLayer( 0 );
DALI_TEST_CHECK( actor.GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) );
END_TEST;
}
DALI_TEST_CHECK( !actor.GetProperty< bool >( Actor::Property::IS_LAYER ) );
// get the root layer
- actor = Stage::GetCurrent().GetLayer( 0 );
+ 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;
}
// Check the size in the new frame
DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ));
- Stage::GetCurrent().Add( actor );
+ 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 >();
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_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;
}
application.Render();
DALI_TEST_CHECK(vector == actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ));
- Stage::GetCurrent().Add( actor );
+ 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( 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;
}
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 );
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 );
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.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 );
DALI_TEST_CHECK(actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ) == scale);
// add to stage and test
- Stage::GetCurrent().Add( actor );
+ 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 parent = Actor::New();
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
parent.SetProperty( Actor::Property::SCALE, parentScale );
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
Vector3 childScale( 2.0f, 2.0f, 2.0f );
Actor parent = Actor::New();
Vector3 parentScale( 1.0f, 2.0f, 3.0f );
parent.SetProperty( Actor::Property::SCALE, parentScale );
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
Vector3 childScale( 2.0f, 2.0f, 2.0f );
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();
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( Actor::Property::OPACITY, 0.9f );
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;
}
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 );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::POSITION, Vector2(10.0f, 10.0f));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// flush the queue and render once
application.SendNotification();
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();
actor.TouchedSignal().Connect( TestCallback );
// 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 );
DALI_TEST_CHECK( gOffStageCallBackCalled == 0 );
// add parent to stage
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
// onstage emitted, offstage not
DALI_TEST_EQUALS( gOnStageCallBackCalled, 1, TEST_LOCATION );
DALI_TEST_EQUALS( gOffStageCallBackCalled, 0, TEST_LOCATION );
gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
gActorNamesOnOffStage.clear();
- Stage::GetCurrent().Remove( parent );
+ application.GetScene().Remove( parent );
// onstage not emitted, offstage is
DALI_TEST_EQUALS( gOnStageCallBackCalled, 0, TEST_LOCATION );
DALI_TEST_EQUALS( gOffStageCallBackCalled, 2, TEST_LOCATION );
gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
gActorNamesOnOffStage.clear();
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
// onstage emitted, offstage not
DALI_TEST_EQUALS( gOnStageCallBackCalled, 2, TEST_LOCATION );
DALI_TEST_EQUALS( gOffStageCallBackCalled, 0, TEST_LOCATION );
gOnStageCallBackCalled = gOffStageCallBackCalled = 0;
gActorNamesOnOffStage.clear();
- Stage::GetCurrent().Remove( parent );
+ application.GetScene().Remove( parent );
// onstage not emitted, offstage is
DALI_TEST_EQUALS( gOnStageCallBackCalled, 0, TEST_LOCATION );
DALI_TEST_EQUALS( gOffStageCallBackCalled, 1, TEST_LOCATION );
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();
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 );
Texture imageA = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
Texture imageB = Texture::New(TextureType::TEXTURE_2D, Pixel::Format::RGBA8888, 16, 16);
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();
parent.SetProperty( Actor::Property::POSITION, parentPosition );
parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
parent.SetProperty( Actor::Property::SCALE, parentScale );
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
child.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
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();
parent.SetProperty( Actor::Property::POSITION, parentPosition );
parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
parent.SetProperty( Actor::Property::SCALE, parentScale );
- Stage::GetCurrent().Add( parent );
+ 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();
parent.SetProperty( Actor::Property::POSITION, parentPosition );
parent.SetProperty( Actor::Property::ORIENTATION, parentRotation );
parent.SetProperty( Actor::Property::SCALE, parentScale );
- Stage::GetCurrent().Add( parent );
+ 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( Actor::Property::OPACITY, 0.7f );
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
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 >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION );
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 >( Actor::Property::OPACITY ), parent.GetCurrentProperty< float >( Actor::Property::OPACITY ), 0.001f, TEST_LOCATION );
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();
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.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.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 2.0 ) );
*
* 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();
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
// 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().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
+ application.GetScene().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
GenerateTrace( application, enabledDisableTrace, stencilTrace );
}
}
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 );
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();
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 );
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
Actor actorA = Actor::New();
actorA.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
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" );
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" );
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.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
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 );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) );
actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Degree( 90.0f), Vector3::ZAXIS ) );
actor.SetProperty( Actor::Property::SCALE, 2.0f );
actor.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false );
- Stage::GetCurrent().Add( actor );
+ 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 );
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" );
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" );
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 = Actor::New();
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 >();
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);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
application.SendNotification();
// Actor removed, last 3 dirty rects are reported. Adaptor would merge them together.
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);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
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);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
actor.RegisterProperty(SHADER_SHADOW_COLOR_PROPERTY_NAME, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
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);
- Stage::GetCurrent().Add(actor);
+ 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);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
application.SendNotification();
std::vector<Rect<int>> damagedRects;
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);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
std::vector<Rect<int>> damagedRects;
/*
- * Copyright (c) 2017 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.
// Register a float property
float startValue(0.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
// Build the animation
/*
- * 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.
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
//
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
// switching between forever and loop count
//
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
// ..and play again
//
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
int UtcDaliAnimationSetDisconnectActionP(void)
{
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
// Default: BakeFinal
{
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
tet_printf("Testing that setting a speed factor of 2 takes half the time\n");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::POSITION, Vector3( testData[actorIndex].startX, 0, 0 ) );
actors.push_back(actor);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
if( actorIndex == 0 || actorIndex == NUM_ENTRIES-1 )
{
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::POSITION, Vector3( testData.startX, 0, 0 ) );
actors.push_back(actor);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
KeyFrames keyframes = KeyFrames::New();
keyframes.Add( testData.startTime, Vector3(testData.startX, 0, 0));
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::POSITION, Vector3( testData.startX, 0, 0 ) );
actors.push_back(actor);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
KeyFrames keyframes = KeyFrames::New();
keyframes.Add( testData.startTime, Vector3(testData.startX, 0, 0));
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Build the animation
float durationSeconds( 1.0f );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Build the animation
Animation animation = Animation::New( 1.0f );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20,20,20), TEST_LOCATION );
// Add to the stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 40% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION );
// Remove from the stage
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 60% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
// Add to the stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 80% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20,20,20), TEST_LOCATION );
// Add to the stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 40% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION );
// Remove from the stage
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 60% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), targetPosition /*bake final*/, TEST_LOCATION );
// Add to the stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 80% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(20,20,20), TEST_LOCATION );
// Add to the stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 40% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40)/*on-stage*/, TEST_LOCATION );
// Remove from the stage
- Stage::GetCurrent().Remove(actor); // baked here
+ application.GetScene().Remove(actor); // baked here
application.SendNotification();
// this render is a no-op in this case as animator is disabled while off stage
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(40,40,40) /*baked value*/, TEST_LOCATION );
// Add back to the stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*200.0f)/* 80% progress */);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /*baked value*/, TEST_LOCATION );
// Remove from the stage
- Stage::GetCurrent().Remove(actor); // baked here
+ application.GetScene().Remove(actor); // baked here
application.SendNotification();
// this render is a no-op in this case as animator is disabled while off stage
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3(88,88,88) /*baked value*/, TEST_LOCATION );
// Add back to the stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// We didn't expect the animation to finish yet
application.SendNotification();
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
// Register a boolean property
bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a boolean property
bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a boolean property
bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a boolean property
bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(1);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(1);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register a quaternion property
const Quaternion startValue( Degree( 90 ), Vector3::XAXIS );
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty< Quaternion >(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< Quaternion >( index ) == startValue );
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(100.0f, 100.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(5.0f, 5.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector2>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(100.0f, 100.0f, 100.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(5.0f, 5.0f, 5.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(100.0f, 100.0f, 100.0f, 100.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(5.0f, 5.0f, 5.0f, 5.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION );
Actor actor = Actor::New();
Vector3 startPosition(10.0f, 10.0f, 10.0f);
actor.SetProperty( Actor::Property::POSITION, startPosition );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
Vector3 startPosition(10.0f, 10.0f, 10.0f);
actor.SetProperty( Actor::Property::POSITION, startPosition );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION );
Actor actor = Actor::New();
Vector3 startPosition(10.0f, 10.0f, 10.0f);
actor.SetProperty( Actor::Property::POSITION, startPosition );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION );
Actor actor = Actor::New();
Vector3 startPosition(10.0f, 10.0f, 10.0f);
actor.SetProperty( Actor::Property::POSITION, startPosition );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), startPosition, TEST_LOCATION );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::ZAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
actor.SetProperty( Actor::Property::VISIBLE, false );
// Register a boolean property
const bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a boolean property
const bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a boolean property
bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a boolean property
bool startValue(false);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_CHECK( actor.GetProperty<bool>(index) == startValue );
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( index ) == startValue );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register an integer property
int startValue(10);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< int >( index ), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(-50.0f, -50.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(1000.0f, 1000.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector2 property
Vector2 startValue(10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty< Vector2 >( index ), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector2 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(-50.0f, -50.0f, -50.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>( index ), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(1000.0f, 1000.0f, 1000.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector3 property
Vector3 startValue(10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector3>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( index ), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(-50.0f, -40.0f, -30.0f, -20.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(1000.0f, 1000.0f, 1000.0f, 1000.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, VECTOR4_EPSILON, TEST_LOCATION );
// Register a Vector4 property
Vector4 startValue(10.0f, 10.0f, 10.0f, 10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<Vector4>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( index ), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_LEFT, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).x, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PARENT_ORIGIN_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).y, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PARENT_ORIGIN_Y), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ).z, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::PARENT_ORIGIN_Z), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), AnchorPoint::CENTER, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).x, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ANCHOR_POINT_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).y, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ANCHOR_POINT_Y), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.5f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ).z, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::ANCHOR_POINT_Z), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).width, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).height, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ).depth, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SIZE ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).x, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).y, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(0.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ).z, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion(Radian(0.0f), Vector3::YAXIS), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::ANGLE_0, Vector3::YAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), Quaternion( Dali::ANGLE_0, Vector3::YAXIS ), ROTATION_EPSILON, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ), Vector3::ONE, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).x, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SCALE_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).y, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SCALE_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector3 >( Actor::Property::SCALE ).z, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SCALE_X), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ), Color::WHITE, TEST_LOCATION );
// Build the animation
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).r, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).g, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).b, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
float startValue(1.0f);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
application.SendNotification();
application.Render(0);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Quaternion start(Radian(aa.angle), aa.axis);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), start, 0.001f, TEST_LOCATION );
Actor actor = Actor::New();
AngleAxis aa(Degree(90), Vector3::XAXIS);
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(aa.angle, aa.axis) );
application.SendNotification();
application.Render(0);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Quaternion start(Radian(aa.angle), aa.axis);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Quaternion >( Actor::Property::ORIENTATION ), start, 0.001f, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float delay = 0.5f;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
float startValue(1.0f);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::COLOR,Vector4(startValue, startValue, startValue, startValue));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Build the path
Vector3 position0( 30.0, 80.0, 0.0);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Build the path
Vector3 position0( 30.0, 80.0, 0.0);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Build the path
Vector3 position0( 30.0, 80.0, 0.0);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Build the path
Vector3 position0( 30.0, 80.0, 0.0);
application.SendNotification();
application.Render(0);
DALI_TEST_CHECK( !actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Start the animation
float durationSeconds(10.0f);
Actor actor = Actor::New();
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Start the animation
float durationSeconds(10.0f);
Actor actor = Actor::New();
DALI_TEST_CHECK( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Start Hide animation
float durationSeconds(10.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Build the animation
Animation animation = Animation::New( 0.0f );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Build the animations
Animation animation1 = Animation::New( 0.0f ); // finishes first frame
// Register a float property
float startValue(10.0f);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<float>(index), startValue, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetCurrentProperty< float >( index ), startValue, TEST_LOCATION );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
int startValue(0u);
Property::Index index = actor.RegisterProperty("anIndex", startValue);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Animation animation = Animation::New( 0.0f );
DALI_TEST_EQUALS( 0.0f, animation.GetDuration(), TEST_LOCATION );
// Register an integer property
int startValue(1);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_ASSERTION(
// Register an integer property
int startValue(1);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_ASSERTION(
// Register an integer property
int startValue(1);
Property::Index index = actor.RegisterProperty( "testProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
DALI_TEST_ASSERTION(
tet_infoline("Set initial position and set up animation to re-position actor");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector3 initialPosition(0.0f, 0.0f, 0.0f);
actor.SetProperty( Actor::Property::POSITION, initialPosition );
tet_infoline("Set initial position and set up animation to re-position actor");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector3 initialPosition(0.0f, 0.0f, 0.0f);
actor.SetProperty( Actor::Property::POSITION, initialPosition );
tet_infoline("Set initial position and set up animation to re-position actor");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector3 initialSize( 10.0f, 10.0f, 10.0f);
Vector3 initialPosition(10.0f, 10.0f, 10.0f);
tet_infoline("Set initial position and set up animation to re-position actor");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector3 initialSize( 10.0f, 5.0f, 10.0f);
actor.SetProperty( Actor::Property::SIZE, initialSize );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
int startValue(1);
Actor actor = Actor::New();
const Property::Index index = actor.RegisterProperty("customProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.Render();
application.SendNotification();
Vector2 startValue( 10.0f, 20.0f );
Actor actor = Actor::New();
const Property::Index index = actor.RegisterProperty("customProperty", startValue );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.Render();
application.SendNotification();
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
{
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
// SpeedFactor < 0
{
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
{
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
// SpeedFactor < 0
{
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
tet_printf("Testing that PlayAfter with the negative delay seconds\n");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
tet_printf("Testing that PlayAfter with progress value\n");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
float durationSeconds(1.0f);
{
// Test Loop forever and Loop mode being set
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
// Default: LoopingMode::RESTART
{
{
// Test Loop Count and Loop mode being set
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
// LoopingMode::AUTO_REVERSE
{
{
// Test Loop Count is 1 (== default) and Loop mode being set
TestApplication application;
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene stage( application.GetScene() );
// LoopingMode::AUTO_REVERSE
{
tet_infoline( "Connect to ProgressReachedSignal but do not set a required Progress marker" );
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animationAlpha = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animationAlpha = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animationAlpha = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New(0.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Create the animation
Animation animation = Animation::New(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Create the animation
Animation animation = Animation::New(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Create the animation
Animation animation = Animation::New(1.0f);
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New( durationSeconds );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build the animation
Animation animation = Animation::New( durationSeconds );
TestApplication application;
auto actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
auto animation = Animation::New( 1.0f );
animation.AnimateTo( Property( actor, Actor::Property::POSITION_X ), 100.0f );
auto actor = Actor::New();
actor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
auto animation = Animation::New( 1.0f );
const float origY = actor.GetProperty( Actor::Property::POSITION_Y ).Get< float >();
auto actor = Actor::New();
actor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
auto animation = Animation::New( 1.0f );
const float origY = actor.GetProperty( Actor::Property::POSITION_Y ).Get< float >();
// Check that the actor is now visible
DALI_TEST_CHECK(actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ) == true);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Build an animation with initial duration of 1 second
float durationSeconds(1.0f);
actor.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
actor.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
DALI_TEST_CHECK( gTouchCallBackCalled == false );
DALI_TEST_EQUALS( actor.GetProjectionMode(), Dali::Camera::PERSPECTIVE_PROJECTION, TEST_LOCATION );
// Add it to the stage, then the values should be updated to reflect a 480.0f by 800.0f scene (default stage size)
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
DALI_TEST_EQUALS( 0.6f, actor.GetProperty( CameraActor::Property::ASPECT_RATIO ).Get< float >(), FLOAT_EPSILON, TEST_LOCATION );
DALI_TEST_EQUALS( 0.489957f, actor.GetProperty( CameraActor::Property::FIELD_OF_VIEW ).Get< float >(), FLOAT_EPSILON, TEST_LOCATION );
DALI_TEST_EQUALS( actor.GetProjectionMode(), Dali::Camera::PERSPECTIVE_PROJECTION, TEST_LOCATION );
// Ensure these values persist after adding to the stage and an update/render pass
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
CameraActor actor = CameraActor::New( Size( 1080.0f, 1920.0f ) );
DALI_TEST_CHECK( actor );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.SetOrthographicProjection( Size( 1080.0f, 1920.0f ) );
application.SendNotification();
tet_infoline( "Testing Dali::CameraActor::SetCamera()" );
CameraActor actor = CameraActor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.Render( 0 );
application.SendNotification();
tet_infoline( "Testing Dali::CameraActor DefaultProperties" );
CameraActor actor = CameraActor::New();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add(actor);
stage.GetRenderTaskList().GetTask(0).SetCameraActor( actor );
actor.SetAspectRatio( TEST_ASPECT_RATIO );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.Render( 0 );
application.SendNotification();
bool bValue;
TestApplication application;
CameraActor actor = CameraActor::New();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add(actor);
stage.GetRenderTaskList().GetTask(0).SetCameraActor( actor );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.Render( 0 );
application.SendNotification();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::POSITION, Vector3( 20.0f, 30.0f, 40.0f ));
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render( 0 );
Matrix resultMatrix( true );
resultMatrix.SetTransformComponents( Vector3::ONE, Quaternion::IDENTITY, actor.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ) );
- RenderTask task = Stage::GetCurrent().GetRenderTaskList().GetTask( 0 );
+ RenderTask task = application.GetScene().GetRenderTaskList().GetTask( 0 );
CameraActor cameraActor = task.GetCameraActor();
Matrix viewMatrix( false );
TestApplication application;
tet_infoline( "Testing Dali::CameraActor::ReadProjectionMatrix()" );
- CameraActor camera = Stage::GetCurrent().GetRenderTaskList().GetTask( 0u ).GetCameraActor();
+ CameraActor camera = application.GetScene().GetRenderTaskList().GetTask( 0u ).GetCameraActor();
application.SendNotification();
application.Render( 0 );
application.Render();
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::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Matrix projectionMatrix;
Matrix viewMatrix;
TestApplication application;
tet_infoline( "Testing Dali::Internal::CameraActor::GetSceneObjectAnimatableProperty()" );
- CameraActor camera = Stage::GetCurrent().GetRenderTaskList().GetTask( 0u ).GetCameraActor();
+ CameraActor camera = application.GetScene().GetRenderTaskList().GetTask( 0u ).GetCameraActor();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Constraint constraint = Constraint::New<Dali::Vector3>( actor, Actor::Property::POSITION, EqualToConstraint() );
constraint.AddSource( Source( camera, Actor::Property::POSITION ) );
int UtcDaliCameraActorPropertyIndices(void)
{
TestApplication application;
- CameraActor camera = Stage::GetCurrent().GetRenderTaskList().GetTask( 0u ).GetCameraActor();
+ CameraActor camera = application.GetScene().GetRenderTaskList().GetTask( 0u ).GetCameraActor();
Actor basicActor = Actor::New();
Property::IndexContainer indices;
int UtcDaliCameraActorCheckLookAtAndFreeLookViews01(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Vector2 stageSize = stage.GetSize();
CameraActor freeLookCameraActor = CameraActor::New( stageSize );
int UtcDaliCameraActorCheckLookAtAndFreeLookViews02(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Vector2 stageSize = stage.GetSize();
CameraActor freeLookCameraActor = CameraActor::New( stageSize );
int UtcDaliCameraActorCheckLookAtAndFreeLookViews03(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Vector2 stageSize = stage.GetSize();
Vector3 targetPosition( Vector3::ZERO );
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Vector3 targetPosition( Vector3::ZERO );
Vector3 cameraOffset( 0.0f, 100.0f, 100.0f );
int UtcConnectionTrackerConstructorP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
ConnectionTracker tracker;
int UtcConnectionTrackerDestructorP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// make sure the ConnectionTracker disconnects form a signal when it
// gets deleted.
TestButton* button = new TestButton(1);
int UtcConnectionTrackerDisconnectAllP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestButton* button = new TestButton(1);
TestApp testApp;
int UtcConnectionTrackerDisconnectAllN(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestApp testApp;
TestButton* button = new TestButton(1);
int UtcConnectionTrackerSignalConnectedP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestButton* button = new TestButton(1);
TestApp testApp;
}
int UtcConnectionTrackerSignalConnectedN(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestButton* button = new TestButton(1);
TestApp* testApp( NULL );
int UtcConnectionTrackerSignalDisconnectP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestButton* button = new TestButton(1);
TestApp testApp;
int UtcConnectionTrackerSignalDisconnectN(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestButton* button = new TestButton(1);
TestApp testApp;
try
{
- app.SignalDisconnected( NULL, NULL );
+ application.SignalDisconnected( NULL, NULL );
tet_result( TET_FAIL );
}
catch (Dali::DaliException& e)
int UtcConnectionTrackerGetConnectionCountP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestButton* button = new TestButton(1);
TestApp testApp;
int UtcConnectionTrackerGetConnectionCountN(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestButton* button = new TestButton(1);
DALI_TEST_CHECK( button->DownSignal().GetConnectionCount( ) == 0 );
/*
- * Copyright (c) 2017 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.
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 0.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Create a Path
Dali::Path path = Dali::Path::New();
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 0.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Create a Path
Dali::Path path = Dali::Path::New();
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 0.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
{
//Create a Path
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 0.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Create a Path
Dali::Path path = Dali::Path::New();
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 0.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Create a LinearConstrainer without specifying progress for values
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 100.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Create a LinearConstrainer
Dali::LinearConstrainer linearConstrainer = Dali::LinearConstrainer::New();
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 0.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
{
//Create a LinearConstrainer
// Register a float property
Property::Index index = actor.RegisterProperty( "t", 0.0f );
- Dali::Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
//Create a LinearConstrainer
Dali::LinearConstrainer linearConstrainer = Dali::LinearConstrainer::New();
/*
- * Copyright (c) 2018 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.
UtcDaliConstraintNewFunction::gConstraintFunctionCalled = false;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
UtcDaliConstraintNewFunction::gConstraintFunctionCalled = false;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
bool functorCalled = false;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
bool sizeFunctorCalled = false;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Actor actor = Actor::New();
Actor clone = Actor::New();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add( actor );
stage.Add( clone );
Actor actor = Actor::New();
Actor clone = Actor::New();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add( actor );
stage.Add( clone );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &BasicFunction< Vector3 > );
Constraint copied( constraint );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
bool functorCalled = false;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( functorCalled, false, TEST_LOCATION );
// Add actor to stage
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
constraint.Remove();
// Add actor to stage
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
// Create an actor and add to stage
Actor actor = Actor::New();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add( actor );
// Create a constraint and apply
// Create an actor and add to stage
Actor actor = Actor::New();
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add( actor );
// Create a constraint and apply
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Create a constraint, add sources
Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &UtcDaliConstraintAddSource::Function );
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Constraint constraint1 = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &TestChaining::Function1 );
Constraint constraint2 = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &TestChaining::Function2 );
Actor actor = Actor::New();
Property::Index index = actor.RegisterProperty( "TEMP_PROPERTY_NAME", value );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Check initial value is fully opaque
application.SendNotification();
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 1.0f, TEST_LOCATION );
// Add the actor back to the stage and check the value, it should be fully opaque again
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Check value when back on-stage, it should be fully opaque as the constraint is no longer applied to it.
application.SendNotification();
TestApplication application;
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Check initial value is fully opaque
application.SendNotification();
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 1.0f, TEST_LOCATION );
// Add the actor back to the stage and check the value, the constraint should have been re-applied
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( actor.GetCurrentProperty< Vector4 >( Actor::Property::COLOR ).a, 0.5f, TEST_LOCATION );
// create a test bitmap actor
Actor actor(CreateBitmapActor());
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
/*
- * Copyright (c) 2017 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.
DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
// add the custom actor to stage
- Stage::GetCurrent().Add( custom );
+ application.GetScene().Add( custom );
DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnStageConnection", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
- Stage::GetCurrent().Remove( custom );
+ application.GetScene().Remove( custom );
DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnStageDisconnection", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION );
actorC.Add( actorF );
// add the custom actor to stage
- Stage::GetCurrent().Add( actorA );
+ application.GetScene().Add( actorA );
DALI_TEST_EQUALS( 4, (int)(actorA.GetMethodsCalled().size()), TEST_LOCATION );
DALI_TEST_EQUALS( "OnPropertySet", actorA.GetMethodsCalled()[ 0 ], TEST_LOCATION );
TestApplication application;
tet_infoline("Testing Dali::CustomActor::OnStageDisconnection() order");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
/* Build tree of actors:
*
TestApplication application;
tet_infoline("Testing Actor::Add behaviour during Dali::CustomActor::OnStageConnection() callback");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
MasterCallStack.clear();
TestApplication application;
tet_infoline("Testing Actor::Remove behaviour during Dali::CustomActor::OnStageConnection() callback");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
MasterCallStack.clear();
TestApplication application;
tet_infoline("Testing Actor::Add behaviour during Dali::CustomActor::OnStageDisonnection() callback");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
/* The actorA is a special variant which adds a child to itself during OnStageDisconnection()
* The actorB is provided as the child
TestApplication application;
tet_infoline("Testing Actor::Remove behaviour during Dali::CustomActor::OnStageDisconnection() callback");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
/* The actorA is a special variant which removes its children during OnStageDisconnection()
* The actorB is provided as the child
TestApplication application;
tet_infoline("Weird test where child removes its own parent from Stage during Dali::CustomActor::OnStageConnection() callback");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
MasterCallStack.clear();
TestApplication application;
tet_infoline("Weird test where child adds its own parent to Stage during Dali::CustomActor::OnStageDisconnection() callback");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
MasterCallStack.clear();
TestApplication application;
tet_infoline("Testing Actor:Add (reparenting) behaviour during Dali::CustomActor::OnChildAdd() callback");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
MasterCallStack.clear();
TestApplication application;
tet_infoline("Testing Actor:Remove behaviour during OnChildRemove() callback triggered when reparenting");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
MasterCallStack.clear();
// set size for custom actor
custom.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
// add the custom actor to stage
- Stage::GetCurrent().Add( custom );
+ application.GetScene().Add( custom );
custom.ResetCallStack();
// Render and notify a couple of times
// set size for custom actor
custom.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
// add the custom actor to stage
- Stage::GetCurrent().Add( custom );
+ application.GetScene().Add( custom );
custom.ResetCallStack();
// Render and notify a couple of times
// set size for custom actor
custom.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
// add the custom actor to stage
- Stage::GetCurrent().Add( custom );
+ application.GetScene().Add( custom );
custom.ResetCallStack();
// Render and notify a couple of times
DALI_TEST_CHECK( gOnRelayout == false );
Test::TestCustomActor custom = Test::TestCustomActor::NewNegoSize();
- Stage::GetCurrent().Add(custom);
+ application.GetScene().Add(custom);
application.SendNotification();
application.Render();
TestApplication application;
tet_infoline("Testing Dali::CustomActor::OnStageConnection() hierarchy depth");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
/* Build tree of actors:
*
TestApplication application; // Need the type registry
Test::TestCustomActor actor = Test::TestCustomActor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
actor.SetProperty( Test::TestCustomActor::Property::TEST_PROPERTY1, 0.5f );
actor.SetProperty( Test::TestCustomActor::Property::TEST_PROPERTY2, Color::WHITE );
TestApplication application; // Need the type registry
auto custom = UnregisteredCustomActor::New();
- Stage::GetCurrent().Add( custom );
+ application.GetScene().Add( custom );
// should have all actor properties
DALI_TEST_EQUALS( custom.GetPropertyType( Actor::Property::COLOR ), Property::VECTOR4, TEST_LOCATION );
DALI_TEST_EQUALS( weakRef.GetHandle().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ), false, TEST_LOCATION );
} );
- Stage::GetCurrent().Remove( custom );
- Stage::GetCurrent().Add( custom );
+ application.GetScene().Remove( custom );
+ application.GetScene().Add( custom );
END_TEST;
}
Dali::TypeRegistration typeRegistration( typeid( UnregisteredCustomActor ), typeid( Dali::CustomActor ), nullptr );
auto derived = DerivedCustomActor::New();
- Stage::GetCurrent().Add( derived );
+ application.GetScene().Add( derived );
// should have all actor properties
DALI_TEST_EQUALS( derived.GetPropertyType( Actor::Property::WORLD_MATRIX ), Property::MATRIX, TEST_LOCATION );
/*
- * Copyright (c) 2016 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.
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
DALI_TEST_EQUALS( geometry.GetNumberOfVertexBuffers(), 1u, TEST_LOCATION );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
TraceCallStack& drawTrace = glAbstraction.GetDrawTrace();
/*
- * 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.
tet_infoline("Positive Test Dali::Handle::GetPropertyIndex() int key");
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Actor actor = Actor::New();
stage.Add( actor );
tet_infoline("Positive Test Dali::Handle::RegisterProperty()");
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Actor actor = Actor::New();
stage.Add( actor );
tet_infoline("Positive Test Dali::Handle::RegisterProperty() int key");
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Actor actor = Actor::New();
stage.Add( actor );
tet_infoline( "Create a custom property and set the value ensuring it can be retrieved synchronously" );
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
tet_infoline( "Create the custom property with an initial value" );
float startValue(1.0f);
tet_infoline( "Get a default and non-animatable custom property using the GetCurrentProperty API" );
Actor actor = Actor::New();
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
DALI_TEST_EQUALS( actor.GetCurrentProperty< bool >( Actor::Property::VISIBLE ), true, TEST_LOCATION );
Property::Index index = actor.RegisterProperty( "testProperty3", 1.0f, Property::READ_WRITE );
ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
auto container = Test::TestCustomActor::New();
- Stage::GetCurrent().Add( container );
+ application.GetScene().Add( container );
auto child = Actor::New();
container.Add( child ); // Resolve child properties (if any)
ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
auto container = Test::TestCustomActor::New();
- Stage::GetCurrent().Add( container );
+ application.GetScene().Add( container );
auto child = Actor::New();
container.Add( child ); // Resolve child properties (if any)
child.SetProperty( CHILD_PROPERTY, 2 );
ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
auto container = Test::TestCustomActor::New();
- Stage::GetCurrent().Add( container );
+ application.GetScene().Add( container );
auto child = Actor::New();
child.RegisterProperty( CHILD_PROPERTY_NAME, Property::Value(3) );
container.Add( child ); // Resolve child properties (if any)
int UtcDaliHandlePropertySetSignal01(void)
{
- TestApplication app;
+ TestApplication application;
bool signalReceived(false);
Property::Value value;
tet_infoline( "Test that setting a default property triggers a signal" );
auto actor = Actor::New();
- DevelHandle::PropertySetSignal(actor).Connect(&app, propertySetCheck);
+ DevelHandle::PropertySetSignal(actor).Connect(&application, propertySetCheck);
actor.SetProperty( Actor::Property::POSITION, Vector3::XAXIS );
propertySetCheck.CheckSignalReceived();
int UtcDaliHandlePropertySetSignal02(void)
{
- TestApplication app;
+ TestApplication application;
bool signalReceived(false);
Property::Value value;
tet_infoline( "Test that setting a custom property triggers a signal" );
auto actor = Actor::New();
- DevelHandle::PropertySetSignal(actor).Connect(&app, propertySetCheck);
+ DevelHandle::PropertySetSignal(actor).Connect(&application, propertySetCheck);
auto propertyIndex = actor.RegisterProperty("propName", 3.0f);
actor.SetProperty( propertyIndex, 5.0f );
int UtcDaliHandlePropertySetSignal03(void)
{
- TestApplication app;
+ TestApplication application;
TypeRegistry typeRegistry = TypeRegistry::Get();
bool signalReceived(false);
ChildPropertyRegistration( customActorTypeInfo.GetName(), CHILD_PROPERTY_NAME, CHILD_PROPERTY, Property::INTEGER );
auto container = Test::TestCustomActor::New();
- Stage::GetCurrent().Add( container );
+ application.GetScene().Add( container );
auto child = Actor::New();
child.RegisterProperty( CHILD_PROPERTY_NAME, Property::Value(3) );
- DevelHandle::PropertySetSignal(child).Connect(&app, propertySetCheck);
+ DevelHandle::PropertySetSignal(child).Connect(&application, propertySetCheck);
container.Add( child ); // Resolve child properties (if any)
DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), true, TEST_LOCATION );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Vector2 stageSize = stage.GetSize();
Actor actor = Actor::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliHoverParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliHoverInterruptedParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
rootData.Reset();
// Remove actor from Stage
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliHoverLeaveParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
actor.SetProperty( Actor::Property::LEAVE_REQUIRED, false );
// Another motion event outside of root actor, only root signalled
- Vector2 stageSize( Stage::GetCurrent().GetSize() );
+ Vector2 stageSize( application.GetScene().GetSize() );
application.ProcessEvent( GenerateSingleHover( TouchPoint::Motion, Vector2 ( stageSize.width + 10.0f, stageSize.height + 10.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliHoverActorBecomesInsensitiveParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
rootData.Reset();
// Remove actor from Stage
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
// Render and notify
application.SendNotification();
int UtcDaliHoverMultipleLayers(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
// Connect to actor's hovered signal
SignalData data;
Layer layer1 ( Layer::New() );
layer1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer1 );
+ application.GetScene().Add( layer1 );
Actor actor1 ( Actor::New() );
actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
layer2.SetProperty( Actor::Property::POSITION_Z, 10.0f ); // Should hit layer2 in this layer rather than actor2
- Stage::GetCurrent().Add( layer2 );
+ application.GetScene().Add( layer2 );
Actor actor2 ( Actor::New() );
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
int UtcDaliHoverMultipleRenderTasks(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
+ Integration::Scene stage ( application.GetScene() );
Vector2 stageSize ( stage.GetSize() );
Actor actor = Actor::New();
// Create render task
Viewport viewport( stageSize.width * 0.5f, stageSize.height * 0.5f, stageSize.width * 0.5f, stageSize.height * 0.5f );
- RenderTask renderTask ( Stage::GetCurrent().GetRenderTaskList().CreateTask() );
+ RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
renderTask.SetViewport( viewport );
renderTask.SetInputEnabled( true );
int UtcDaliHoverMultipleRenderTasksWithChildLayer(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
+ Integration::Scene stage ( application.GetScene() );
Vector2 stageSize ( stage.GetSize() );
Actor actor = Actor::New();
// Create render task
Viewport viewport( stageSize.width * 0.5f, stageSize.height * 0.5f, stageSize.width * 0.5f, stageSize.height * 0.5f );
- RenderTask renderTask ( Stage::GetCurrent().GetRenderTaskList().CreateTask() );
+ RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
renderTask.SetViewport( viewport );
renderTask.SetInputEnabled( true );
renderTask.SetSourceActor( actor );
int UtcDaliHoverOffscreenRenderTasks(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
+ Integration::Scene stage ( application.GetScene() );
Vector2 stageSize ( stage.GetSize() );
// FrameBufferImage for offscreen RenderTask
int UtcDaliHoverMultipleRenderableActors(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
+ Integration::Scene stage ( application.GetScene() );
Vector2 stageSize ( stage.GetSize() );
Actor parent = CreateRenderableActor();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
data.Reset();
// Re-add, render and notify
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
data.Reset();
// Re-add actor back to stage, render and notify
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
data.Reset();
// Remove actor from stage
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
// Render and notify
application.SendNotification();
int UtcDaliHoverLeaveActorReadded(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
int UtcDaliHoverClippingActor(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
/*
- * Copyright (c) 2017 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.
Layer layer1 = Layer::New();
Layer layer2 = Layer::New();
- // layers are not on stage
+ // layers are not on scene
DALI_TEST_EQUALS(layer1.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION);
DALI_TEST_EQUALS(layer2.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION);
// root depth is 0
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
DALI_TEST_EQUALS(root.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION);
- Stage::GetCurrent().Add(layer1);
- Stage::GetCurrent().Add(layer2);
+ application.GetScene().Add(layer1);
+ application.GetScene().Add(layer2);
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION);
DALI_TEST_EQUALS(layer1.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION);
Layer layer1 = Layer::New();
Layer layer2 = Layer::New();
- Stage::GetCurrent().Add(layer1);
- Stage::GetCurrent().Add(layer2);
+ application.GetScene().Add(layer1);
+ application.GetScene().Add(layer2);
DALI_TEST_EQUALS(layer1.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION);
layer1.Raise();
DALI_TEST_EQUALS(layer1.GetProperty< int >( Layer::Property::DEPTH ), 2u, TEST_LOCATION);
// get root
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION);
root.Raise();
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION);
Layer layer1 = Layer::New();
Layer layer2 = Layer::New();
- Stage::GetCurrent().Add(layer1);
- Stage::GetCurrent().Add(layer2);
+ application.GetScene().Add(layer1);
+ application.GetScene().Add(layer2);
DALI_TEST_EQUALS(layer2.GetProperty< int >( Layer::Property::DEPTH ), 2u, TEST_LOCATION);
layer2.Lower();
DALI_TEST_EQUALS(layer2.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION);
// get root
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
root.Lower();
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION);
layer2.Lower();
Layer layer2 = Layer::New();
Layer layer3 = Layer::New();
- Stage::GetCurrent().Add(layer1);
- Stage::GetCurrent().Add(layer2);
- Stage::GetCurrent().Add(layer3);
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ application.GetScene().Add(layer1);
+ application.GetScene().Add(layer2);
+ application.GetScene().Add(layer3);
+ Layer root = application.GetScene().GetLayer( 0 );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION);
DALI_TEST_EQUALS(layer1.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION);
Layer layer2 = Layer::New();
Layer layer3 = Layer::New();
- Stage::GetCurrent().Add(layer1);
- Stage::GetCurrent().Add(layer2);
- Stage::GetCurrent().Add(layer3);
+ application.GetScene().Add(layer1);
+ application.GetScene().Add(layer2);
+ application.GetScene().Add(layer3);
DALI_TEST_EQUALS(layer1.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION);
DALI_TEST_EQUALS(layer2.GetProperty< int >( Layer::Property::DEPTH ), 2u, TEST_LOCATION);
actor2.SetProperty( Actor::Property::SIZE, Vector2( 1, 1 ) );
actor2.SetProperty( Actor::Property::COLOR, Vector4(1, 1, 1, 0.5f ) ); // 50% transparent
- // add to stage
- Stage::GetCurrent().Add( actor );
- Stage::GetCurrent().Add( actor2 );
+ // add to scene
+ application.GetScene().Add( actor );
+ application.GetScene().Add( actor2 );
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
gTestSortFunctionCalled = 0;
root.SetSortFunction(TestSortFunction);
TestApplication application;
Layer layer = Layer::New();
// try to raise above root layer
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
layer.RaiseAbove( root );
- // layer depth is zero as its not on stage
+ // layer depth is zero as its not on scene
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
- // add to stage
- Stage::GetCurrent().Add( layer );
+ // add to scene
+ application.GetScene().Add( layer );
layer.RaiseAbove( root );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
root.RaiseAbove( layer );
layer.RaiseAbove( layer );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
- // make another layer on the stage
+ // make another layer on the scene
Layer layer2 = Layer::New();
- Stage::GetCurrent().Add( layer2 );
+ application.GetScene().Add( layer2 );
layer.RaiseAbove( layer2 );
DALI_TEST_GREATER( layer.GetProperty< int >( Layer::Property::DEPTH ), layer2.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
layer2.RaiseAbove( layer );
TestApplication application;
Layer layer = Layer::New();
// try to lower below root layer
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
layer.LowerBelow( root );
- // layer depth is zero as its not on stage
+ // layer depth is zero as its not on scene
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
- // add to stage
- Stage::GetCurrent().Add( layer );
+ // add to scene
+ application.GetScene().Add( layer );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
layer.LowerBelow( root );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
layer.LowerBelow( layer );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
- // make another layer on the stage
+ // make another layer on the scene
Layer layer2 = Layer::New();
- Stage::GetCurrent().Add( layer2 );
+ application.GetScene().Add( layer2 );
layer.LowerBelow( layer2 );
DALI_TEST_GREATER( layer2.GetProperty< int >( Layer::Property::DEPTH ), layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
layer2.LowerBelow( layer );
TestApplication application;
Layer layer = Layer::New();
// try to raise above root layer
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
layer.MoveAbove( root );
- // layer depth is zero as its not on stage
+ // layer depth is zero as its not on scene
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
root.MoveAbove( layer );
- // root depth is zero as layer is not on stage
+ // root depth is zero as layer is not on scene
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
- // add to stage
- Stage::GetCurrent().Add( layer );
+ // add to scene
+ application.GetScene().Add( layer );
layer.MoveAbove( root );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
- // make another layer on the stage
+ // make another layer on the scene
Layer layer2 = Layer::New();
- Stage::GetCurrent().Add( layer2 );
+ application.GetScene().Add( layer2 );
layer.MoveAbove( layer2 );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), layer2.GetProperty< int >( Layer::Property::DEPTH ) + 1u, TEST_LOCATION );
layer2.MoveAbove( root );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), layer.GetProperty< int >( Layer::Property::DEPTH ) + 1u, TEST_LOCATION );
Layer layer3 = Layer::New();
- Stage::GetCurrent().Add( layer3 );
+ application.GetScene().Add( layer3 );
DALI_TEST_EQUALS( layer3.GetProperty< int >( Layer::Property::DEPTH ), 3u, TEST_LOCATION );
root.MoveAbove( layer3 );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 3u, TEST_LOCATION );
DALI_TEST_EQUALS( layer3.GetProperty< int >( Layer::Property::DEPTH ), 2u, TEST_LOCATION );
- DALI_TEST_EQUALS( Stage::GetCurrent().GetLayer( 0 ).GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
- layer3.MoveAbove( Stage::GetCurrent().GetLayer( 0 ) );
+ DALI_TEST_EQUALS( application.GetScene().GetLayer( 0 ).GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
+ layer3.MoveAbove( application.GetScene().GetLayer( 0 ) );
DALI_TEST_EQUALS( layer3.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
END_TEST;
}
TestApplication application;
Layer layer = Layer::New();
// try to raise above root layer
- Layer root = Stage::GetCurrent().GetLayer( 0 );
+ Layer root = application.GetScene().GetLayer( 0 );
layer.MoveBelow( root );
- // layer depth is zero as its not on stage
+ // layer depth is zero as its not on scene
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
root.MoveBelow( layer );
- // root depth is zero as layer is not on stage
+ // root depth is zero as layer is not on scene
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
- // add to stage
- Stage::GetCurrent().Add( layer );
+ // add to scene
+ application.GetScene().Add( layer );
layer.MoveBelow( root );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), 1u, TEST_LOCATION );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 0u, TEST_LOCATION );
- // make another layer on the stage
+ // make another layer on the scene
Layer layer2 = Layer::New();
- Stage::GetCurrent().Add( layer2 );
+ application.GetScene().Add( layer2 );
layer.MoveBelow( layer2 );
DALI_TEST_EQUALS( layer.GetProperty< int >( Layer::Property::DEPTH ), layer2.GetProperty< int >( Layer::Property::DEPTH ) - 1u, TEST_LOCATION );
layer2.MoveBelow( root );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), layer.GetProperty< int >( Layer::Property::DEPTH ) - 1u, TEST_LOCATION );
Layer layer3 = Layer::New();
- Stage::GetCurrent().Add( layer3 );
+ application.GetScene().Add( layer3 );
DALI_TEST_EQUALS( layer3.GetProperty< int >( Layer::Property::DEPTH ), 3u, TEST_LOCATION );
root.MoveBelow( layer3 );
DALI_TEST_EQUALS( root.GetProperty< int >( Layer::Property::DEPTH ), 2u, TEST_LOCATION );
{
TestApplication application;
const TestGlAbstraction::ScissorParams& glScissorParams( application.GetGlAbstraction().GetScissorParams() );
- Stage stage( Stage::GetCurrent() );
+ Integration::Scene scene( application.GetScene() );
ClippingBox testBox( 5, 6, 77, 83 );
- Layer layer = Stage::GetCurrent().GetRootLayer();
+ Layer layer = application.GetScene().GetRootLayer();
layer.SetProperty( Layer::Property::CLIPPING_ENABLE, true );
layer.SetProperty( Layer::Property::CLIPPING_BOX, testBox );
// Add at least one renderable actor so the GL calls are actually made
Texture img = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor actor = CreateRenderableActor( img );
- stage.Add( actor );
+ scene.Add( actor );
// flush the queue and render once
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( testBox.x, glScissorParams.x, TEST_LOCATION );
- DALI_TEST_EQUALS( testBox.y, (int)(stage.GetSize().height - glScissorParams.y - testBox.height), TEST_LOCATION ); // GL Coordinates are from bottom left
+ DALI_TEST_EQUALS( testBox.y, (int)(scene.GetSize().height - glScissorParams.y - testBox.height), TEST_LOCATION ); // GL Coordinates are from bottom left
DALI_TEST_EQUALS( testBox.width, glScissorParams.width, TEST_LOCATION );
DALI_TEST_EQUALS( testBox.height, glScissorParams.height, TEST_LOCATION );
END_TEST;
TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
TraceCallStack& enabledDisableTrace = glAbstraction.GetEnableDisableTrace();
- Stage::GetCurrent().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
+ application.GetScene().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
// Create an actor.
Actor actor = CreateActor( false );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Create child actors.
Actor child1 = CreateActor( true );
/*
- * 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.
// Functor that removes the gestured actor from stage
struct UnstageActorFunctor : public GestureReceivedFunctor
{
- UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage )
+ UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
: GestureReceivedFunctor( data ),
- stateToUnstage( stateToUnstage )
+ stateToUnstage( stateToUnstage ),
+ scene( scene )
{
}
if ( longPress.state == stateToUnstage )
{
- Stage::GetCurrent().Remove( actor );
+ scene.Remove( actor );
}
}
Gesture::State& stateToUnstage;
+ Integration::Scene scene;
};
// Functor for receiving a touch event
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Remove the actor from stage and reset the data
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion( Dali::Degree(90.0f), Vector3::ZAXIS ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Set child to completely cover parent.
// Change rotation of child to be different from parent so that we can check if our local coordinate
Actor first = Actor::New();
first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
second.SetProperty( Actor::Property::POSITION_X, 100.0f);
second.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
LongPressGestureDetector detector = LongPressGestureDetector::New();
detector.Attach(actor);
detector.DetectedSignal().Connect( &application, functor );
application.Render();
// Re-add actor to stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Create and add a second actor so that GestureDetector destruction does not come into play.
Actor dummyActor( Actor::New() );
dummyActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummyActor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
dummyActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummyActor);
+ application.GetScene().Add(dummyActor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
LongPressGestureDetector detector = LongPressGestureDetector::New();
detector.Attach(actor);
detector.Attach(dummyActor);
application.Render();
// Re add to the stage, we should not be signalled
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a detector
SignalData data;
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.RaiseToTop();
// Render and notify
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Render and notify
application.SendNotification();
/*
- * 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.
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Actor actor2 = Actor::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
actor2.SetProperty( Actor::Property::POSITION_X, 100.0f);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
// Render and notify
application.SendNotification();
/*
- * 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.
// Functor that removes the gestured actor from stage
struct UnstageActorFunctor : public GestureReceivedFunctor
{
- UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage )
+ UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
: GestureReceivedFunctor( data ),
- stateToUnstage( stateToUnstage )
+ stateToUnstage( stateToUnstage ),
+ scene( scene )
{
}
if ( pan.state == stateToUnstage )
{
- Stage::GetCurrent().Remove( actor );
+ scene.Remove( actor );
}
}
Gesture::State& stateToUnstage;
+ Integration::Scene scene;
};
// Functor for receiving a touch event
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
detector.Attach(actor);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor tempActor = Actor::New();
tempActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
tempActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(tempActor);
+ application.GetScene().Add(tempActor);
detector.Attach(tempActor);
uint32_t time = 100;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Remove the actor from stage and reset the data
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Set child to completely cover parent.
// Change rotation of child to be different from parent so that we can check if our local coordinate
Actor first = Actor::New();
first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
second.SetProperty( Actor::Property::POSITION_X, 100.0f);
second.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Render and notify
application.SendNotification();
detector.Attach(second);
detector.DetectedSignal().Connect(&application, functor);
- DALI_TEST_EQUALS(Stage::GetCurrent().GetRootLayer(), first.GetParent(), TEST_LOCATION);
- DALI_TEST_EQUALS(Stage::GetCurrent().GetRootLayer(), second.GetParent(), TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetScene().GetRootLayer(), first.GetParent(), TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetScene().GetRootLayer(), second.GetParent(), TEST_LOCATION);
// Start pan within second actor's area
uint32_t time = 100;
TestStartPan( application, Vector2( 110.0f, 20.0f ), Vector2( 126.0f, 20.0f ), time );
- DALI_TEST_EQUALS(Stage::GetCurrent().GetRootLayer(), first.GetParent(), TEST_LOCATION);
- DALI_TEST_EQUALS(Stage::GetCurrent().GetRootLayer(), second.GetParent(), TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetScene().GetRootLayer(), first.GetParent(), TEST_LOCATION);
+ DALI_TEST_EQUALS(application.GetScene().GetRootLayer(), second.GetParent(), TEST_LOCATION);
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
DALI_TEST_EQUALS(true, second == data.pannedActor, TEST_LOCATION);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Actor actor2 = Actor::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
// Render and notify
application.SendNotification();
Actor actor1 = Actor::New();
actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor1);
+ application.GetScene().Add(actor1);
SignalData data1;
GestureReceivedFunctor functor1(data1);
PanGestureDetector detector1 = PanGestureDetector::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
actor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
SignalData data2;
GestureReceivedFunctor functor2(data2);
PanGestureDetector detector2 = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( parent );
+ application.GetScene().Add( parent );
Actor child = Actor::New();
child.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
PanGestureDetector detector = PanGestureDetector::New();
detector.Attach(actor);
detector.DetectedSignal().Connect( &application, functor );
application.Render();
// Re-add actor to stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
application.Render();
// Re-add actor to stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Create and add a second actor so that GestureDetector destruction does not come into play.
Actor dummyActor( Actor::New() );
dummyActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummyActor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
dummyActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummyActor);
+ application.GetScene().Add(dummyActor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
PanGestureDetector detector = PanGestureDetector::New();
detector.Attach(actor);
detector.Attach(dummyActor);
application.Render();
// Re add to the stage, we should not be signalled
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor child = Actor::New();
child.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor child = Actor::New();
child.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.RaiseToTop();
// Render and notify
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a pan detector
PanGestureDetector detector = PanGestureDetector::New();
/*
- * 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.
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
/*
- * 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.
// Functor that removes the gestured actor from stage
struct UnstageActorFunctor : public GestureReceivedFunctor
{
- UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage )
+ UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
: GestureReceivedFunctor( data ),
- stateToUnstage( stateToUnstage )
+ stateToUnstage( stateToUnstage ),
+ scene( scene )
{
}
if ( pinch.state == stateToUnstage )
{
- Stage::GetCurrent().Remove( actor );
+ scene.Remove( actor );
}
}
Gesture::State& stateToUnstage;
+ Integration::Scene scene;
};
// Functor for receiving a touch event
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor tempActor = Actor::New();
tempActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
tempActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(tempActor);
+ application.GetScene().Add(tempActor);
detector.Attach(tempActor);
// Actor lifetime is scoped
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
// Remove the actor from stage and reset the data
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify a couple of times
application.SendNotification();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Set child to completely cover parent.
// Change rotation of child to be different from parent so that we can check if our local coordinate
Actor first = Actor::New();
first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
second.SetProperty( Actor::Property::POSITION_X, 100.0f);
second.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Actor actor2 = Actor::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
// Render and notify
application.SendNotification();
Actor actor1 = Actor::New();
actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor1);
+ application.GetScene().Add(actor1);
SignalData data1;
GestureReceivedFunctor functor1(data1);
PinchGestureDetector detector1 = PinchGestureDetector::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
actor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
SignalData data2;
GestureReceivedFunctor functor2(data2);
PinchGestureDetector detector2 = PinchGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
PinchGestureDetector detector = PinchGestureDetector::New();
detector.Attach(actor);
detector.DetectedSignal().Connect( &application, functor );
application.Render();
// Re-add actor to stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
application.Render();
// Re-add actor to stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Create and add a second actor so that GestureDetector destruction does not come into play.
Actor dummyActor( Actor::New() );
dummyActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummyActor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
dummyActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummyActor);
+ application.GetScene().Add(dummyActor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
PinchGestureDetector detector = PinchGestureDetector::New();
detector.Attach(actor);
detector.Attach(dummyActor);
application.Render();
// Re add to the stage, we should not be signalled
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a detector
SignalData data;
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.RaiseToTop();
// Render and notify
/*
- * 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.
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Actor actor2 = Actor::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
actor2.SetProperty( Actor::Property::POSITION_X, 100.0f);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Render and notify
application.SendNotification();
/*
- * Copyright (c) 2016 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.
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE,Vector3::ONE * 100.f);
actor.AddRenderer(renderer);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
{
public:
- TestClass()
+ TestClass(Integration::Scene scene )
+ : mScene( scene )
{
}
void Initialize()
{
mActor = Actor::New();
- Stage::GetCurrent().Add( mActor );
+ mScene.Add( mActor );
mNotification = mActor.AddPropertyNotification( Actor::Property::POSITION_X, GreaterThanCondition(100.0f) );
mNotification.NotifySignal().Connect( this, &TestClass::OnPropertyNotify );
}
void Terminate()
{
- Stage::GetCurrent().Remove( mActor );
+ mScene.Remove( mActor );
mActor.Reset();
mNotification.Reset();
}
Actor mActor;
PropertyNotification mNotification;
+ Integration::Scene mScene;
};
{
TestApplication application; // Reset all test adapter return codes
- TestClass* object = new TestClass;
+ TestClass* object = new TestClass(application.GetScene());
object->Initialize();
application.Render(RENDER_FRAME_INTERVAL);
tet_infoline(" UtcDaliPropertyNotificationGreaterThan");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION_X, GreaterThanCondition(100.0f) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationLessThan");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION_X, LessThanCondition(100.0f ) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationInside");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION_X, InsideCondition(100.0f, 200.0f) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationOutside");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION_X, OutsideCondition(100.0f, 200.0f) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationGreaterThan");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION, 0, GreaterThanCondition(100.0f) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationLessThan");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION, 0, LessThanCondition(-100.0f) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationInside");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION, 0, InsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationOutside");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
PropertyNotification notification = actor.AddPropertyNotification( Actor::Property::POSITION, 0, OutsideCondition(-100.0f, 100.0f) );
notification.NotifySignal().Connect( &TestCallback );
tet_infoline(" UtcDaliPropertyNotificationStep");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
const float step = 100.0f;
// float
tet_infoline(" UtcDaliPropertyNotificationStep");
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Dali::Vector<float> values;
TestApplication application; // Reset all test adapter return codes
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// this should complete in first frame
PropertyNotification notification1 = actor.AddPropertyNotification( Actor::Property::POSITION_X, GreaterThanCondition(90.0f) );
notification1.NotifySignal().Connect( &TestCallback );
bool glSync)
{
// Change main render task to use a different root
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
taskList.GetTask(0u).SetSourceActor( rootActor );
FrameBuffer frameBuffer = FrameBuffer::New(10,10);
tet_infoline("Testing RenderTask::DownCast()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
BaseHandle base = taskList.GetTask( 0u );
DALI_TEST_CHECK( base );
{
TestApplication application;
tet_infoline("Testing RenderTask::SetSourceActor() Negative - try with empty actor handle");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Actor srcActor;
tet_infoline("Testing RenderTask::SetSourceActor() Positive - check that setting a non-renderable actor stops existing source actor being rendered ");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
RenderTaskList taskList = stage.GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::SetSourceActor() Positive - check that switching source from a non-renderable to a renderable actor causes the texture to be drawn");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
RenderTaskList taskList = stage.GetRenderTaskList();
tet_infoline("Testing RenderTask::SetSourceActor (on/off stage testing)");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
RenderTaskList taskList = stage.GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::SetSourceActor (empty handle case)");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
RenderTaskList taskList = stage.GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline( "Testing RenderTask::SetSourceActor - Set a source actor and destroy the source actor" );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
RenderTaskList taskList = stage.GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::GetSourceActor() Check the default render task has a valid source actor");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
DALI_TEST_CHECK( actor );
// By default the entire scene should be rendered
- Actor root = Stage::GetCurrent().GetLayer( 0 );
+ Actor root = application.GetScene().GetLayer( 0 );
DALI_TEST_CHECK( root == actor );
END_TEST;
}
tet_infoline("Testing RenderTask::GetSourceActor() Create a new render task, Add a new actor to the stage and set it as the source of the new render task. Get its source actor and check that it is equivalent to what was set.");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.CreateTask();
Actor actor = Actor::New();
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
task.SetSourceActor( actor );
DALI_TEST_EQUALS( actor, task.GetSourceActor(), TEST_LOCATION );
tet_infoline("Testing RenderTask::SetExclusive() Check that exclusion works");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
// Manipulate the GenTextures behaviour, to identify different actors
Texture img1 = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor actor1 = CreateRenderableActor( img1 );
actor1.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
- Stage::GetCurrent().Add( actor1 );
+ application.GetScene().Add( actor1 );
// Update & Render actor1
application.SendNotification();
// Force actor2 to be rendered before actor1
Layer layer = Layer::New();
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.Add( actor2 );
layer.LowerToBottom();
// Force actor3 to be rendered before actor2
layer = Layer::New();
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.Add( actor3 );
layer.LowerToBottom();
Texture img1 = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 1, 1 );
Actor actor1 = CreateRenderableActor( img1 );
actor1.SetProperty( Actor::Property::SIZE, Vector2( 1.0f, 1.0f ) );
- Stage::GetCurrent().Add( actor1 );
+ application.GetScene().Add( actor1 );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.CreateTask();
task.SetSourceActor( actor1 );
tet_infoline("Testing RenderTask::IsExclusive() Check default values are non-exclusive");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
// Not exclusive is the default
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::IsExclusive() Check the getter returns set values");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
// Not exclusive is the default
RenderTask newTask = taskList.CreateTask();
tet_infoline("Testing RenderTask::SetInputEnabled()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
// Input is enabled by default
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::GetInputEnabled()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
// Input is enabled by default
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::SetCameraActor()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::SetCameraActor() with empty actor handle");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline( "Testing RenderTask::SetCameraActor - Set a camera actor and destroy the camera actor" );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
RenderTaskList taskList = stage.GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::GetCameraActor()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::SetFrameBuffer()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::SetFrameBuffer()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
FrameBuffer newFrameBuffer; // Empty handle
tet_infoline("Testing RenderTask::GetFrameBuffer()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::GetFrameBuffer()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::SetScreenToFrameBufferFunction()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::GetScreenToFrameBufferFunction()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
TestApplication application;
tet_infoline("Testing RenderTask::GetScreenToFrameBufferMappingActor ");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask renderTask = taskList.CreateTask();
Actor mappingActor = Actor::New();
renderTask.SetScreenToFrameBufferMappingActor(mappingActor);
TestApplication application;
tet_infoline("Testing RenderTask::GetScreenToFrameBufferMappingActor with empty task handle");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask renderTask = taskList.CreateTask();
Actor actor;
renderTask.SetScreenToFrameBufferMappingActor(actor);
tet_infoline("Testing RenderTask::GetViewport() on default task");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
Viewport viewport = task.GetViewport();
// By default the viewport should match the stage width/height
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Viewport expectedViewport( 0, 0, stageSize.width, stageSize.height );
DALI_TEST_CHECK( viewport == expectedViewport );
END_TEST;
tet_infoline("Testing RenderTask::GetViewport() on new task");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.CreateTask();
Viewport viewport = task.GetViewport();
// By default the viewport should match the stage width/height
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Viewport expectedViewport( 0, 0, stageSize.width, stageSize.height );
DALI_TEST_CHECK( viewport == expectedViewport );
END_TEST;
tet_infoline("Testing RenderTask::SetViewport()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Viewport newViewport( 0, 0, stageSize.width * 0.5f, stageSize.height * 0.5f );
task.SetViewport( newViewport );
tet_infoline("Testing RenderTask::SetViewport()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task;
try
{
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Viewport newViewport( 0, 0, stageSize.width * 0.5f, stageSize.height * 0.5f );
task.SetViewport( newViewport );
}
tet_infoline("Testing RenderTask::SetViewportPosition()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
// By default the viewport should match the stage width/height
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Viewport expectedViewport( 0, 0, stageSize.width, stageSize.height );
DALI_TEST_CHECK( viewport == expectedViewport );
tet_infoline("Testing RenderTask::SetViewportSize()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
// By default the viewport should match the stage width/height
- Vector2 stageSize = Stage::GetCurrent().GetSize();
+ Vector2 stageSize = application.GetScene().GetSize();
Viewport expectedViewport( 0, 0, stageSize.width, stageSize.height );
DALI_TEST_CHECK( viewport == expectedViewport );
Vector4 testColor( 1.0f, 2.0f, 3.0f, 4.0f );
Vector4 testColor2( 5.0f, 6.0f, 7.0f, 8.0f );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
DALI_TEST_CHECK( task.GetClearColor() != testColor );
tet_infoline("Testing RenderTask::GetClearColor()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
DALI_TEST_EQUALS( task.GetClearColor(), RenderTask::DEFAULT_CLEAR_COLOR, TEST_LOCATION );
END_TEST;
tet_infoline("Testing RenderTask::SetClearEnabled()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
DALI_TEST_CHECK( task.GetClearEnabled() ); // defaults to true
tet_infoline("Testing RenderTask::GetClearEnabled()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
DALI_TEST_CHECK( task.GetClearEnabled() ); // defaults to true
tet_infoline("Testing RenderTask::SetCullMode()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
DALI_TEST_EQUALS( task.GetCullMode(), true, TEST_LOCATION );
tet_infoline("Testing RenderTask::GetCullMode()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
DALI_TEST_EQUALS( task.GetCullMode(), true, TEST_LOCATION );
END_TEST;
tet_infoline("Testing RenderTask::SetRefreshRate()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
// By default tasks will be processed every frame
RenderTask task = taskList.GetTask( 0u );
tet_infoline("Testing RenderTask::GetRefreshRate()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
// By default tasks will be processed every frame
RenderTask task = taskList.GetTask( 0u );
CameraActor offscreenCameraActor = CameraActor::New();
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 10, 10 );
Actor rootActor = CreateRenderableActor( image );
rootActor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
NativeImageInterfacePtr testNativeImagePtr = TestNativeImage::New(10, 10);
Texture frameBufferTexture = Texture::New( *testNativeImagePtr );
FrameBuffer frameBuffer = FrameBuffer::New(frameBufferTexture.GetWidth(),frameBufferTexture.GetHeight());
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
application.GetPlatform().ClearReadyResources();
// ADD SOURCE ACTOR TO STAGE - expect continuous renders to start, no finished signal
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
application.SendNotification();
// CONTINUE PROCESS/RENDER Input, Expected Input, Expected
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
secondRootActor.SetProperty( Actor::Property::VISIBLE,false);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
bool finished = false;
application.GetPlatform().ClearReadyResources();
// ADD CAMERA ACTOR TO STAGE - expect continuous renders to start, no finished signal
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
application.SendNotification();
// CONTINUE PROCESS/RENDER Input, Expected Input, Expected
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ONCE, true);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Shader shader = CreateShader();
Texture image = CreateTexture();
Actor secondRootActor = Actor::New();
secondRootActor.AddRenderer(renderer);
secondRootActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ONCE, true);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Shader shader = CreateShader();
Texture image = CreateTexture();
Actor secondRootActor = Actor::New();
secondRootActor.AddRenderer(renderer);
secondRootActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, true);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ONCE, false);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Shader shader = CreateShader();
Texture image = CreateTexture();
Actor secondRootActor = Actor::New();
secondRootActor.AddRenderer(renderer);
secondRootActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ONCE, false);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, false);
bool finished = false;
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Shader shader = CreateShader();
Texture image = CreateTexture();
Actor secondRootActor = Actor::New();
secondRootActor.AddRenderer(renderer);
secondRootActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, false);
drawTrace.Enable(true);
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor secondRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask newTask = CreateRenderTask(application, offscreenCameraActor, rootActor, secondRootActor, RenderTask::REFRESH_ALWAYS, false);
bool finished = false;
drawTrace.Enable(true);
Actor defaultRootActor = Actor::New(); // Root for default RT
- Stage::GetCurrent().Add( defaultRootActor );
+ application.GetScene().Add( defaultRootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor firstRootActor = CreateRenderableActorSuccess(application, "aFile.jpg");
- Stage::GetCurrent().Add(firstRootActor);
+ application.GetScene().Add(firstRootActor);
// first render task
RenderTask firstTask = CreateRenderTask(application, offscreenCameraActor, defaultRootActor, firstRootActor, RenderTask::REFRESH_ONCE, false);
// Second render task
FrameBuffer fbo = firstTask.GetFrameBuffer();
Actor secondRootActor = CreateRenderableActor( fbo.GetColorTexture() );
- Stage::GetCurrent().Add(secondRootActor);
+ application.GetScene().Add(secondRootActor);
RenderTask secondTask = CreateRenderTask(application, offscreenCameraActor, defaultRootActor, secondRootActor, RenderTask::REFRESH_ONCE, false);
bool secondFinished = false;
RenderTaskFinished renderTask2Finished( secondFinished );
{
TestApplication application;
- RenderTask task = Stage::GetCurrent().GetRenderTaskList().CreateTask();
+ RenderTask task = application.GetScene().GetRenderTaskList().CreateTask();
Property::IndexContainer indices;
task.GetPropertyIndices( indices );
CameraActor offscreenCameraActor = CameraActor::New();
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 10, 10 );
Actor rootActor = CreateRenderableActor( image );
rootActor.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
rootActor.SetProperty( Actor::Property::VISIBLE,false);
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
NativeImageInterfacePtr testNativeImagePtr = TestNativeImage::New(10, 10);
Texture frameBufferTexture = Texture::New( *testNativeImagePtr );
FrameBuffer frameBuffer = FrameBuffer::New(frameBufferTexture.GetWidth(), frameBufferTexture.GetHeight());
// Previously we had bugs where not having a resource ID would cause render-tasks to wait forever
tet_infoline("Testing RenderTask::SignalFinished() when an Actor has no Image set");
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
Texture image = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 10, 10 );
Actor rootActor = CreateRenderableActor( image );
actorWithMissingImage.SetProperty( Actor::Property::SIZE, Vector2( 10.0f, 10.0f ) );
stage.Add( actorWithMissingImage );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask newTask = taskList.CreateTask();
newTask.SetInputEnabled( false );
newTask.SetClearColor( Vector4( 0.f, 0.f, 0.f, 0.f ) );
{
TestApplication application( 400u, 400u ); // square surface
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3(0.5, 0.5, 0.5) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, Vector3(0.5, 0.5, 0.5) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
actor2.SetProperty( Actor::Property::POSITION, Vector3(0.0, 0.0, 0.0) );
actor2.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3(0.5, 0.5, 0.0) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT, Vector3(0.5, 0.5, 0.0) );
- Stage::GetCurrent().Add( actor2 );
+ application.GetScene().Add( actor2 );
actor2.Add(actor);
actor.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3(0,0,0) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::POSITION, Vector2(10.0f, 10.0f));
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.GetTask( 0u );
// flush the queue and render once
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::POSITION, Vector2( 10.0f, 10.0f ));
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask task = taskList.CreateTask();
FrameBuffer newFrameBuffer = FrameBuffer::New(10, 10);
task.SetScreenToFrameBufferMappingActor( actor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
task.SetCameraActor( offscreenCameraActor );
// flush the queue and render once
int UtcDaliRenderTaskRequiresSync(void)
{
TestApplication application;
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask newTask = taskList.CreateTask();
newTask.SetProperty( RenderTask::Property::REQUIRES_SYNC, false );
TestGlAbstraction& gl = application.GetGlAbstraction();
Actor renderableActor = CreateRenderableActorSuccess( application, "aFile.jpg" );
- Stage::GetCurrent().Add( renderableActor );
+ application.GetScene().Add( renderableActor );
Actor rootActor = Actor::New();
- Stage::GetCurrent().Add( rootActor );
+ application.GetScene().Add( rootActor );
CameraActor offscreenCameraActor = CameraActor::New( Size( TestApplication::DEFAULT_SURFACE_WIDTH, TestApplication::DEFAULT_SURFACE_HEIGHT ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
Actor sourceActor = CreateRenderableActorSuccess( application, "aFile.jpg" );
- Stage::GetCurrent().Add( sourceActor );
+ application.GetScene().Add( sourceActor );
RenderTask newTask = CreateRenderTask( application, offscreenCameraActor, rootActor, sourceActor, RenderTask::REFRESH_ALWAYS, false );
/*
- * 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.
tet_infoline("Testing RenderTaskList::DownCast()");
- BaseHandle base = Stage::GetCurrent().GetRenderTaskList();
+ BaseHandle base = application.GetScene().GetRenderTaskList();
RenderTaskList taskList = RenderTaskList::DownCast( base );
tet_infoline("Testing RenderTaskList::CreateTask()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
taskList.CreateTask();
tet_infoline("Testing RenderTaskList::RemoveTask()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
RenderTask newTask = taskList.CreateTask();
tet_infoline("Testing RenderTaskList::RemoveTask() which has an exclusive actor set");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
RenderTask newTask = taskList.CreateTask();
tet_infoline("Testing RenderTaskList::GetTaskCount()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
taskList.RemoveTask( taskList.GetTask(0u) );
tet_infoline("Testing RenderTaskList::GetTask()");
- RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
RenderTask defaultTask = taskList.GetTask( 0u );
DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
DALI_TEST_CHECK( defaultTask );
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
TestGlAbstraction& gl = application.GetGlAbstraction();
application.SendNotification();
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// By default, none of the faces should be culled
unsigned int cullFace = renderer.GetProperty<int>( Renderer::Property::FACE_CULLING_MODE );
actor.SetProperty( Actor::Property::OPACITY, 0.5f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::ONE_MINUS_SRC_COLOR );
renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::SRC_ALPHA_SATURATE );
actor.SetProperty( Actor::Property::OPACITY, 0.5f ); // enable blending
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB, BlendFactor::CONSTANT_COLOR );
renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB, BlendFactor::ONE_MINUS_CONSTANT_COLOR );
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Test the defaults as documented in blending.h
int equationRgb = renderer.GetProperty<int>( Renderer::Property::BLEND_EQUATION_RGB );
actor.SetProperty( Actor::Property::OPACITY, 0.1f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Test the single blending equation setting
{
actor.SetProperty( Actor::Property::OPACITY, 0.98f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON);
actor.SetProperty( Actor::Property::OPACITY, 0.0f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON);
actor.SetProperty( Actor::Property::OPACITY, 0.15f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::OFF);
actor.SetProperty( Actor::Property::OPACITY, 0.75f );
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
actor.SetProperty( Actor::Property::COLOR, Vector4(1.0f, 0.0f, 1.0f, 0.5f) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
actor.SetProperty( Actor::Property::COLOR, Color::MAGENTA );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::AUTO);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
actor.SetProperty( Actor::Property::COLOR, Vector4(1.0f, 0.0f, 1.0f, 0.5f) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Property::Value value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
bool preMultipliedAlpha;
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector4 initialColor = Color::WHITE;
Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector4 initialColor = Color::WHITE;
Property::Index colorIndex = renderer.RegisterProperty( "uFadeColor", initialColor );
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Shader shader = Shader::New("VertexSource", "FragmentSource");
Geometry geometry = CreateQuadGeometry();
- Actor root = Stage::GetCurrent().GetRootLayer();
+ Actor root = application.GetScene().GetRootLayer();
Actor actor0 = CreateActor( root, 0, TEST_LOCATION );
Renderer renderer0 = CreateRenderer( actor0, geometry, shader, 0 );
Shader shader = Shader::New("VertexSource", "FragmentSource");
Geometry geometry = CreateQuadGeometry();
- Actor root = Stage::GetCurrent().GetRootLayer();
+ Actor root = application.GetScene().GetRootLayer();
Actor actor0 = CreateActor( root, 0, TEST_LOCATION );
Actor actor1 = CreateActor( actor0, 0, TEST_LOCATION );
Shader shader = Shader::New("VertexSource", "FragmentSource");
Geometry geometry = CreateQuadGeometry();
- Actor root = Stage::GetCurrent().GetRootLayer();
+ Actor root = application.GetScene().GetRootLayer();
Actor actor0 = CreateActor( root, 1, TEST_LOCATION );
Actor actor1 = CreateActor( root, 0, TEST_LOCATION );
Actor actor2 = CreateActor( actor0, 0, TEST_LOCATION );
Shader shader = Shader::New("VertexSource", "FragmentSource");
Geometry geometry = CreateQuadGeometry();
- Actor root = Stage::GetCurrent().GetRootLayer();
+ Actor root = application.GetScene().GetRootLayer();
/*
* Create the following hierarchy:
Renderer renderer = Renderer::New( geometry, shader );
actor.AddRenderer( renderer );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.Add( actor );
char buffer[ 128 ];
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
stage.Add(actor);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
/*
* Here we use a templatized function to perform several checks on each enumeration property.
Actor actor = Actor::New();
actor.AddRenderer( renderer );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage stage = Stage::GetCurrent();
+ Integration::Scene stage = application.GetScene();
stage.GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D );
stage.Add( actor );
// Change the layer behavior to LAYER_UI.
// Note this will also disable depth testing for the layer by default, we test this first.
- Stage::GetCurrent().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_UI );
+ application.GetScene().GetRootLayer().SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_UI );
glEnableDisableStack.Reset();
application.SendNotification();
DALI_TEST_CHECK( glEnableDisableStack.FindMethodAndParams( "Disable", GetDepthTestString() ) );
// Turn the layer depth-test flag back on, and confirm that depth testing is now on.
- Stage::GetCurrent().GetRootLayer().SetProperty(Layer::Property::DEPTH_TEST, true );
+ application.GetScene().GetRootLayer().SetProperty(Layer::Property::DEPTH_TEST, true );
glEnableDisableStack.Reset();
application.SendNotification();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::POSITION, Vector2(0.0f,0.0f));
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
TestGlAbstraction& gl = application.GetGlAbstraction();
TraceCallStack& drawTrace = gl.GetDrawTrace();
actor.AddRenderer( renderer );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Value value = renderer.GetProperty( DevelRenderer::Property::OPACITY );
float opacity;
actor.AddRenderer( renderer );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer( renderer );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render(0);
actor.AddRenderer( renderer );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Property::Value value = renderer.GetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR );
int renderingBehavior;
actor.AddRenderer( renderer );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
actor.SetProperty( Actor::Property::COLOR, Vector4( 1.0f, 0.0f, 1.0f, 1.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
/*
- * 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.
// Functor that removes the gestured actor from stage
struct UnstageActorFunctor : public GestureReceivedFunctor
{
- UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage )
+ UnstageActorFunctor( SignalData& data, Gesture::State& stateToUnstage, Integration::Scene scene )
: GestureReceivedFunctor( data ),
- stateToUnstage( stateToUnstage )
+ stateToUnstage( stateToUnstage ),
+ scene( scene )
{
}
if ( rotation.state == stateToUnstage )
{
- Stage::GetCurrent().Remove( actor );
+ scene.Remove( actor );
}
}
Gesture::State& stateToUnstage;
+ Integration::Scene scene;
};
// Functor for receiving a touch event
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor tempActor = Actor::New();
tempActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
tempActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(tempActor);
+ application.GetScene().Add(tempActor);
detector.Attach(tempActor);
// Actor lifetime is scoped
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS(Gesture::Continuing, data.receivedGesture.state, TEST_LOCATION);
// Remove the actor from stage and reset the data
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify a couple of times
application.SendNotification();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Set child to completely cover parent.
// Change rotation of child to be different from parent so that we can check if our local coordinate
Actor first = Actor::New();
first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
second.SetProperty( Actor::Property::POSITION_X, 100.0f);
second.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Actor actor2 = Actor::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
// Render and notify
application.SendNotification();
Actor actor1 = Actor::New();
actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor1);
+ application.GetScene().Add(actor1);
SignalData data1;
GestureReceivedFunctor functor1(data1);
RotationGestureDetector detector1 = RotationGestureDetector::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::BOTTOM_RIGHT);
actor2.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::BOTTOM_RIGHT);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
SignalData data2;
GestureReceivedFunctor functor2(data2);
RotationGestureDetector detector2 = RotationGestureDetector::New();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
RotationGestureDetector detector = RotationGestureDetector::New();
detector.Attach(actor);
detector.DetectedSignal().Connect( &application, functor );
application.Render();
// Re-add actor to stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
application.Render();
// Re-add actor to stage
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Create and add a second actor so that GestureDetector destruction does not come into play.
Actor dummyActor( Actor::New() );
dummyActor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
dummyActor.SetProperty( Actor::Property::POSITION, Vector2( 100.0f, 100.0f ));
dummyActor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(dummyActor);
+ application.GetScene().Add(dummyActor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data, stateToUnstage );
+ UnstageActorFunctor functor( data, stateToUnstage, application.GetScene() );
RotationGestureDetector detector = RotationGestureDetector::New();
detector.Attach(actor);
detector.Attach(dummyActor);
application.Render();
// Re add to the stage, we should not be signalled
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a detector
SignalData data;
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.RaiseToTop();
// Render and notify
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
TestGlAbstraction& gl = application.GetGlAbstraction();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
TestGlAbstraction& gl = application.GetGlAbstraction();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
TestGlAbstraction& gl = application.GetGlAbstraction();
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render before resizing surface
application.SendNotification();
glAbstraction.EnableViewportCallTrace( true );
// Initial scene setup
- auto stage = Stage::GetCurrent();
+ auto scene = application.GetScene();
Geometry geometry = CreateQuadGeometry();
Shader shader = CreateShader();
int testWidth = 400;
int testHeight = 400;
actor.SetProperty( Actor::Property::SIZE, Vector2( testWidth, testHeight) );
- stage.Add(actor);
+ scene.Add(actor);
CameraActor offscreenCameraActor = CameraActor::New( Size( testWidth, testHeight ) );
- Stage::GetCurrent().Add( offscreenCameraActor );
+ application.GetScene().Add( offscreenCameraActor );
FrameBuffer newFrameBuffer = FrameBuffer::New( testWidth, testHeight, FrameBuffer::Attachment::NONE );
- RenderTask newTask = stage.GetRenderTaskList().CreateTask();
+ RenderTask newTask = scene.GetRenderTaskList().CreateTask();
newTask.SetCameraActor( offscreenCameraActor );
newTask.SetSourceActor( actor );
newTask.SetFrameBuffer( newFrameBuffer );
DALI_TEST_CHECK( defaultScene );
// Ensure stage size matches the scene size
+ auto stage = Stage::GetCurrent();
DALI_TEST_EQUALS( stage.GetSize(), defaultScene.GetSize(), TEST_LOCATION );
// Resize the scene
actor.AddRenderer( renderer );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400, 400 ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
// Render
application.SendNotification();
DALI_TEST_EQUALS( application.GetRenderNeedsPostRender(), true, TEST_LOCATION );
// Remove the Renderer
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
actor.Reset();
renderer.Reset();
Actor actor = Actor::New();
actor.AddRenderer( renderer );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
Dali::Integration::Scene scene = application.GetScene();
Actor actor = Actor::New();
(actor.*method)( ( T ) values[i].value );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( NULL != map.Find( keyName ) );
DALI_TEST_EQUALS( map.Find( keyName )->Get< std::string >(), values[i].string, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
}
}
Actor handle = NewActor( map );
DALI_TEST_CHECK( handle );
- Stage::GetCurrent().Add( handle );
+ application.GetScene().Add( handle );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::INHERIT_ORIENTATION ), false, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetProperty< bool >( Actor::Property::INHERIT_SCALE ), false, TEST_LOCATION );
- Stage::GetCurrent().Remove( handle );
+ application.GetScene().Remove( handle );
}
// Check Anchor point and parent origin vector3s
Actor handle = NewActor( map );
DALI_TEST_CHECK( handle );
- Stage::GetCurrent().Add( handle );
+ application.GetScene().Add( handle );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( handle.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_CENTER, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), AnchorPoint::TOP_LEFT, TEST_LOCATION );
- Stage::GetCurrent().Remove( handle );
+ application.GetScene().Remove( handle );
}
// Check Anchor point and parent origin STRINGS
Actor handle = NewActor( map );
DALI_TEST_CHECK( handle );
- Stage::GetCurrent().Add( handle );
+ application.GetScene().Add( handle );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( handle.GetCurrentProperty< Vector3 >( Actor::Property::PARENT_ORIGIN ), ParentOrigin::TOP_LEFT, TEST_LOCATION );
DALI_TEST_EQUALS( handle.GetCurrentProperty< Vector3 >( Actor::Property::ANCHOR_POINT ), AnchorPoint::CENTER_LEFT, TEST_LOCATION );
- Stage::GetCurrent().Remove( handle );
+ application.GetScene().Remove( handle );
}
END_TEST;
}
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::NAME,"Actor1");
actor.SetProperty( Actor::Property::COLOR,Color::CYAN);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Animation anim = data.CreateAnimation( actor, 0.5f );
anim.Play();
Actor handle = NewActor( map );
DALI_TEST_CHECK( handle );
- Stage::GetCurrent().Add( handle );
+ application.GetScene().Add( handle );
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( child1.GetCurrentProperty< Vector3 >( Actor::Property::POSITION ), Vector3::YAXIS, TEST_LOCATION );
DALI_TEST_EQUALS( child1.GetChildCount(), 0u, TEST_LOCATION );
- Stage::GetCurrent().Remove( handle );
+ application.GetScene().Remove( handle );
END_TEST;
}
DALI_TEST_CHECK( NULL != map.Find( "type" ) );
DALI_TEST_EQUALS( map.Find( "type")->Get< std::string >(), "Actor", TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
}
// Layer Type
DALI_TEST_CHECK( NULL != map.Find( "type" ) );
DALI_TEST_EQUALS( map.Find( "type" )->Get< std::string >(), "Layer", TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
}
// Default properties
actor.SetProperty( Actor::Property::INHERIT_SCALE, false );
actor.SetProperty( Actor::Property::SIZE_MODE_FACTOR, Vector3::ONE );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( NULL != map.Find( "sizeModeFactor" ) );
DALI_TEST_EQUALS( map.Find( "sizeModeFactor" )->Get< Vector3 >(), Vector3::ONE, TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
}
// Children
Actor child = Layer::New();
actor.Add( child );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
application.SendNotification();
application.Render();
DALI_TEST_CHECK( childMap.Find( "type" ) );
DALI_TEST_EQUALS( childMap.Find( "type" )->Get< std::string >(), "Layer", TEST_LOCATION );
- Stage::GetCurrent().Remove( actor );
+ application.GetScene().Remove( actor );
}
END_TEST;
}
/*
- * Copyright (c) 2017 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.
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector4 initialColor = Color::WHITE;
Property::Index colorIndex = shader.RegisterProperty( "uFadeColor", initialColor );
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Vector4 initialColor = Color::WHITE;
Property::Index colorIndex = shader.RegisterProperty( "uFadeColor", initialColor );
Actor actor = Actor::New();
actor.AddRenderer(renderer);
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render(0);
/*
- * Copyright (c) 2015 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.
// Note: It is at this point that the delegate internally makes the connection.
testObject.ConnectToInternalMember();
- // Add the actor to the stage to trigger it's "onStage" signal.
+ // Add the actor to the scene to trigger it's "onStage" signal.
// If the delegate connected correctly, this will call the member
// function in the test object and set a global flag.
- Stage::GetCurrent().Add( connectActor );
+ application.GetScene().Add( connectActor );
// Check the global flag to confirm the signal was received.
DALI_TEST_CHECK( gSignalReceived );
// Check the signal delegate has made the connection.
DALI_TEST_CHECK( signalDelegate.IsConnected() );
- // Add the actor to the stage to trigger it's "onStage" signal.
+ // Add the actor to the scene to trigger it's "onStage" signal.
// If the delegate connected correctly, this will call the () operator of our
// passed-in functor, the functor will in turn set a global flag.
- Stage::GetCurrent().Add( connectActor );
+ application.GetScene().Add( connectActor );
// Check the global flag to confirm the signal was received.
DALI_TEST_CHECK( gSignalReceived );
int UtcDaliSignalEmptyP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// Test that Empty() is true, when no slots connected to the signal
int UtcDaliSignalEmptyN(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// Test that Empty() is false after signal connection
TestSignals::VoidRetNoParamSignal signal;
int UtcDaliSignalGetConnectionCountP(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestSignals::VoidRetNoParamSignal signal;
TestSlotHandler handler;
int UtcDaliSignalGetConnectionCountN(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestSignals::VoidRetNoParamSignal signal;
DALI_TEST_CHECK( signal.GetConnectionCount() == 0 );
END_TEST;
*/
int UtcDaliSignalConnectP01(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test static function: void Connect( void (*func)() )
TestSignals::VoidRetNoParamSignal signal;
// difficult to perform a negative test on Connect as no checks are performed
// when creating a callback for a null function ( during Connect).
// so we test an assert on Emit
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestSignals::VoidRetNoParamSignal signal;
signal.Connect( NULL );
int UtcDaliSignalConnectP02(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test member function: Connect( X* obj, void (X::*func)() ))
TestSignals::VoidRetNoParamSignal signal;
int UtcDaliSignalConnectN02(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestSignals::VoidRetNoParamSignal signal;
try
int UtcDaliSignalConnectP03(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test slot delegate: Connect( SlotDelegate<X>& delegate, void (X::*func)() )
TestSignals::VoidRetNoParamSignal signal;
int UtcDaliSignalConnectN03(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// the delegate is passed by reference, so you can't pass null.
tet_result( TET_PASS );
END_TEST;
int UtcDaliSignalConnectP04(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test function object: Connect( ConnectionTrackerInterface* connectionTracker, const X& func )
TestSlotHandler handler;
int UtcDaliSignalConnectP05(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test function object using FunctorDelegate.
// :Connect( ConnectionTrackerInterface* connectionTracker, FunctorDelegate* delegate )
int UtcDaliSignalConnectN05(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// for negative test we try to connect a null connection tracker to the signal
// :Connect( ConnectionTrackerInterface == NULL, FunctorDelegate* delegate )
*/
int UtcDaliSignalDisconnectP01(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test static function: Disconnect( void (*func)( Arg0 arg0 ) )
}
int UtcDaliSignalDisconnectN01(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// 1. Disconnect using the function
TestSignals::VoidRetNoParamSignal signal;
int UtcDaliSignalDisconnectP02(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test member function: Disconnect( X* obj, void (X::*func)( Arg0 arg0 ) )
TestSignals::VoidRetNoParamSignal signal;
}
int UtcDaliSignalDisconnectN02(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// 1. Disconnect using a null connection tracker
TestSignals::VoidRetNoParamSignal signal;
int UtcDaliSignalDisconnectP03(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// test slot delegate: Disconnect( SlotDelegate<X>& delegate, void (X::*func)( Arg0 arg0 ) )
TestSignals::VoidRetNoParamSignal signal;
int UtcDaliSignalDisconnectN03(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// try to disconnect from the wrong signal
TestSignals::VoidRetNoParamSignal signal;
int UtcDaliSignalEmitDuringCallback(void)
{
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
// for coverage purposes we test the emit guard for each signal type (0,1,2,3 params) void / return value
{
// testing a signal deletion during an emit
// need to dynamically allocate the signal for this to work
- TestApplication app; // Create core for debug logging
+ TestApplication application; // Create core for debug logging
TestSignals::VoidRetNoParamSignal* signal = new TestSignals::VoidRetNoParamSignal;
/*
- * Copyright (c) 2018 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.
int UtcDaliStageContextLostSignalP(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage = Stage::GetCurrent();
bool contextLost = false;
ContextStatusFunctor contextLostFunctor( contextLost );
- stage.ContextLostSignal().Connect( &app, contextLostFunctor );
+ stage.ContextLostSignal().Connect( &application, contextLostFunctor );
- Integration::ContextNotifierInterface* notifier = app.GetCore().GetContextNotifier();
+ Integration::ContextNotifierInterface* notifier = application.GetCore().GetContextNotifier();
notifier->NotifyContextLost();
DALI_TEST_EQUALS( contextLost, true, TEST_LOCATION );
int UtcDaliStageContextLostSignalN(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage;
// Check that connecting to the signal with a bad stage instance causes an assert.
ContextStatusFunctor contextLostFunctor( contextLost );
try
{
- stage.ContextLostSignal().Connect( &app, contextLostFunctor );
+ stage.ContextLostSignal().Connect( &application, contextLostFunctor );
}
catch( Dali::DaliException& e )
{
int UtcDaliStageContextRegainedSignalP(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage = Stage::GetCurrent();
bool contextRegained = false;
ContextStatusFunctor contextRegainedFunctor( contextRegained );
- stage.ContextRegainedSignal().Connect( &app, contextRegainedFunctor );
+ stage.ContextRegainedSignal().Connect( &application, contextRegainedFunctor );
- Integration::ContextNotifierInterface* notifier = app.GetCore().GetContextNotifier();
+ Integration::ContextNotifierInterface* notifier = application.GetCore().GetContextNotifier();
notifier->NotifyContextLost();
notifier->NotifyContextRegained();
DALI_TEST_EQUALS( contextRegained, true, TEST_LOCATION );
int UtcDaliStageContextRegainedSignalN(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage;
// Check that connecting to the signal with a bad stage instance causes an assert.
ContextStatusFunctor contextRegainedFunctor( contextRegained );
try
{
- stage.ContextRegainedSignal().Connect( &app, contextRegainedFunctor );
+ stage.ContextRegainedSignal().Connect( &application, contextRegainedFunctor );
}
catch( Dali::DaliException& e )
{
int UtcDaliStageSceneCreatedSignalP(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage = Stage::GetCurrent();
bool signalCalled = false;
SceneCreatedStatusFunctor sceneCreatedFunctor( signalCalled );
- stage.SceneCreatedSignal().Connect( &app, sceneCreatedFunctor );
+ stage.SceneCreatedSignal().Connect( &application, sceneCreatedFunctor );
- Integration::Core& core = app.GetCore();
+ Integration::Core& core = application.GetCore();
core.SceneCreated();
DALI_TEST_EQUALS( signalCalled, true, TEST_LOCATION );
int UtcDaliStageSceneCreatedSignalN(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage;
// Check that connecting to the signal with a bad stage instance causes an assert.
SceneCreatedStatusFunctor sceneCreatedFunctor( signalCalled );
try
{
- stage.SceneCreatedSignal().Connect( &app, sceneCreatedFunctor );
+ stage.SceneCreatedSignal().Connect( &application, sceneCreatedFunctor );
}
catch( Dali::DaliException& e )
{
int UtcDaliStageGetRenderTaskListP(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage = Stage::GetCurrent();
// Check we get a valid instance.
int UtcDaliStageGetRenderTaskListN(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage;
// Check that getting the render task list with a bad stage instance causes an assert.
int UtcDaliStageGetObjectRegistryP(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage = Stage::GetCurrent();
ObjectRegistry objectRegistry = stage.GetObjectRegistry();
// However we want a basic test to confirm the returned registry is valid and works.
bool verified = false;
ActorCreatedFunctor test( verified );
- objectRegistry.ObjectCreatedSignal().Connect( &app, test );
+ objectRegistry.ObjectCreatedSignal().Connect( &application, test );
Actor actor = Actor::New();
DALI_TEST_CHECK( test.mSignalVerified );
int UtcDaliStageGetObjectRegistryN(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage;
// Check that getting the object registry with a bad stage instance DOES NOT cause an assert.
int UtcDaliStageOperatorAssign(void)
{
- TestApplication app;
+ TestApplication application;
Stage stage;
DALI_TEST_CHECK( !stage );
/*
- * 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.
// Functor that removes the gestured actor from stage
struct UnstageActorFunctor : public GestureReceivedFunctor
{
- UnstageActorFunctor( SignalData& data ) : GestureReceivedFunctor( data ) { }
+ UnstageActorFunctor( SignalData& data, Integration::Scene scene )
+ : GestureReceivedFunctor( data ),
+ scene( scene )
+ {
+ }
void operator()(Actor actor, const TapGesture& tap)
{
GestureReceivedFunctor::operator()( actor, tap );
- Stage::GetCurrent().Remove( actor );
+ scene.Remove( actor );
}
+
+ Integration::Scene scene;
};
// Functor for receiving a touch event
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS(true, data.functorCalled, TEST_LOCATION);
// Remove the actor from stage and reset the data
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Dali::Degree(90.0f), Vector3::ZAXIS) );
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
// Set child to completely cover parent.
// Change rotation of child to be different from parent so that we can check if our local coordinate
Actor first = Actor::New();
first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
second.SetProperty( Actor::Property::POSITION_X, 100.0f);
second.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(second);
+ application.GetScene().Add(second);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor first = Actor::New();
first.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
first.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(first);
+ application.GetScene().Add(first);
Actor second = Actor::New();
second.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
// Attach actor to detector
SignalData data;
- UnstageActorFunctor functor( data );
+ UnstageActorFunctor functor( data, application.GetScene() );
TapGestureDetector detector = TapGestureDetector::New();
detector.Attach(actor);
detector.DetectedSignal().Connect( &application, functor );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
TestStartLongPress( application, 50.0f, 10.0f, 100 );
// Remove, render and delete actor
- Stage::GetCurrent().Remove(actor);
+ application.GetScene().Remove(actor);
application.SendNotification();
application.Render();
actor.Reset();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Add a detector
SignalData data;
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.RaiseToTop();
// Render and notify
/*
- * 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.
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
Actor actor2 = Actor::New();
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
actor2.SetProperty( Actor::Property::POSITION_X, 100.0f);
- Stage::GetCurrent().Add(actor2);
+ application.GetScene().Add(actor2);
// Render and notify
application.SendNotification();
Actor actor = CreateActor( DONT_SET_SAMPLER );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
TestGlAbstraction& gl = application.GetGlAbstraction();
Actor actor = CreateActor(SET_SAMPLER);
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
TestGlAbstraction& gl = application.GetGlAbstraction();
Actor actor1 = CreateActor(SET_SAMPLER);
Actor actor2 = CreateActor(SET_SAMPLER);
- Stage::GetCurrent().Add( actor1 );
- Stage::GetCurrent().Add( actor2 );
+ application.GetScene().Add( actor1 );
+ application.GetScene().Add( actor2 );
TestGlAbstraction& gl = application.GetGlAbstraction();
actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
actor.SetProperty( Actor::Property::SIZE, Vector2( 400.0f, 400.0f ) );
- Stage::GetCurrent().Add( actor );
+ application.GetScene().Add( actor );
TestGlAbstraction& gl = application.GetGlAbstraction();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
- Vector2 stageSize = stage.GetSize();
+ Integration::Scene scene = application.GetScene();
+ Vector2 sceneSize = scene.GetSize();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- stage.Add(actor);
+ scene.Add(actor);
// Render and notify
application.SendNotification();
application.Render();
// Get the camera's near and far planes
- RenderTaskList taskList = stage.GetRenderTaskList();
+ RenderTaskList taskList = scene.GetRenderTaskList();
Dali::RenderTask task = taskList.GetTask(0);
CameraActor camera = task.GetCameraActor();
float nearPlane = camera.GetNearClippingPlane();
// Calculate the current distance of the actor from the camera
float tanHalfFov = tanf(camera.GetFieldOfView() * 0.5f);
- float distance = (stageSize.y * 0.5f) / tanHalfFov;
+ float distance = (sceneSize.y * 0.5f) / tanHalfFov;
// Connect to actor's touched signal
SignalData data;
TouchDataFunctor functor( data );
actor.TouchSignal().Connect( &application, functor );
- Vector2 screenCoordinates( stageSize.x * 0.5f, stageSize.y * 0.5f );
+ Vector2 screenCoordinates( sceneSize.x * 0.5f, sceneSize.y * 0.5f );
// Emit a down signal
application.ProcessEvent( GenerateSingleTouch( PointState::DOWN, screenCoordinates ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchDataParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchDataInterruptedParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
data.Reset();
rootData.Reset();
- // Remove actor from Stage
- Stage::GetCurrent().Remove( actor );
+ // Remove actor from scene
+ application.GetScene().Remove( actor );
data.Reset();
rootData.Reset();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchDataLeaveParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
actor.SetProperty( Actor::Property::LEAVE_REQUIRED, false );
// Another motion event outside of root actor, only root signalled
- Vector2 stageSize( Stage::GetCurrent().GetSize() );
- application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2 ( stageSize.width + 10.0f, stageSize.height + 10.0f )) );
+ Vector2 sceneSize( application.GetScene().GetSize() );
+ application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2 ( sceneSize.width + 10.0f, sceneSize.height + 10.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( PointState::LEAVE, rootData.touchData.points[0].state, TEST_LOCATION );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchDataActorBecomesInsensitiveParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchDataMultipleLayers(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
// Connect to actor's touched signal
SignalData data;
Layer layer1 ( Layer::New() );
layer1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer1 );
+ application.GetScene().Add( layer1 );
Actor actor1 ( Actor::New() );
actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
layer2.SetProperty( Actor::Property::POSITION_Z, 10.0f ); // Should hit layer2 in this layer rather than actor2
- Stage::GetCurrent().Add( layer2 );
+ application.GetScene().Add( layer2 );
Actor actor2 ( Actor::New() );
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
int UtcDaliTouchDataMultipleRenderTasks(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(actor);
+ scene.Add(actor);
// Create render task
- Viewport viewport( stageSize.width * 0.5f, stageSize.height * 0.5f, stageSize.width * 0.5f, stageSize.height * 0.5f );
- RenderTask renderTask ( Stage::GetCurrent().GetRenderTaskList().CreateTask() );
+ Viewport viewport( sceneSize.width * 0.5f, sceneSize.height * 0.5f, sceneSize.width * 0.5f, sceneSize.height * 0.5f );
+ RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
renderTask.SetViewport( viewport );
renderTask.SetInputEnabled( true );
int UtcDaliTouchDataMultipleRenderTasksWithChildLayer(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(actor);
+ scene.Add(actor);
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.Add(layer);
// Create render task
- Viewport viewport( stageSize.width * 0.5f, stageSize.height * 0.5f, stageSize.width * 0.5f, stageSize.height * 0.5f );
- RenderTask renderTask ( Stage::GetCurrent().GetRenderTaskList().CreateTask() );
+ Viewport viewport( sceneSize.width * 0.5f, sceneSize.height * 0.5f, sceneSize.width * 0.5f, sceneSize.height * 0.5f );
+ RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
renderTask.SetViewport( viewport );
renderTask.SetInputEnabled( true );
renderTask.SetSourceActor( actor );
int UtcDaliTouchDataOffscreenRenderTasks(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
// FrameBufferImage for offscreen RenderTask
- FrameBuffer frameBuffer = FrameBuffer::New(stageSize.width, stageSize.height);
+ FrameBuffer frameBuffer = FrameBuffer::New(sceneSize.width, sceneSize.height);
// Create a renderable actor to display the FrameBufferImage
Actor renderableActor = CreateRenderableActor(frameBuffer.GetColorTexture());
renderableActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- renderableActor.SetProperty( Actor::Property::SIZE, Vector2( stageSize.x, stageSize.y ) );
+ renderableActor.SetProperty( Actor::Property::SIZE, Vector2( sceneSize.x, sceneSize.y ) );
renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
- stage.Add( renderableActor );
+ scene.Add( renderableActor );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add( actor );
+ scene.Add( actor );
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); // Ensure framebuffer connects
- stage.GetRenderTaskList().GetTask( 0u ).SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
+ scene.GetRenderTaskList().GetTask( 0u ).SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
// Create a RenderTask
- RenderTask renderTask = stage.GetRenderTaskList().CreateTask();
+ RenderTask renderTask = scene.GetRenderTaskList().CreateTask();
renderTask.SetSourceActor( actor );
renderTask.SetFrameBuffer(frameBuffer);
renderTask.SetInputEnabled( true );
// Create another RenderTask
- RenderTask renderTask2( stage.GetRenderTaskList().CreateTask() );
+ RenderTask renderTask2( scene.GetRenderTaskList().CreateTask() );
renderTask2.SetInputEnabled( true );
// Render and notify
int UtcDaliTouchDataMultipleRenderableActors(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
Actor parent = CreateRenderableActor();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(parent);
+ scene.Add(parent);
Actor actor = CreateRenderableActor();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
data.Reset();
// Re-add, render and notify
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
- // Re-add actor back to stage, render and notify
- Stage::GetCurrent().Add(actor);
+ // Re-add actor back to scene, render and notify
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
END_TEST;
}
-int UtcDaliTouchDataActorUnStaged(void)
+int UtcDaliTouchDataActorRemovedFromScene(void)
{
TestApplication application;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- // Remove actor from stage
- Stage::GetCurrent().Remove( actor );
+ // Remove actor from scene
+ application.GetScene().Remove( actor );
data.Reset();
// Render and notify
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.RaiseToTop();
// Render and notify
int UtcDaliTouchDataLeaveActorReadded(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene scene = application.GetScene();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(actor);
+ scene.Add(actor);
// Set actor to receive touch-events
actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- // Remove actor from stage and add again
- stage.Remove( actor );
- stage.Add( actor );
+ // Remove actor from scene and add again
+ scene.Remove( actor );
+ scene.Add( actor );
// Emit a motion within the actor's bounds
application.ProcessEvent( GenerateSingleTouch( PointState::MOTION, Vector2( 12.0f, 10.0f ) ) );
int UtcDaliTouchDataClippedActor(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene scene = application.GetScene();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- stage.Add( actor );
+ scene.Add( actor );
Actor clippingActor = Actor::New();
clippingActor.SetProperty( Actor::Property::SIZE, Vector2( 50.0f, 50.0f ) );
clippingActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
clippingActor.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- stage.Add( clippingActor );
+ scene.Add( clippingActor );
// Add a child to the clipped region.
Actor clippingChild = Actor::New();
END_TEST;
}
-int UtcDaliTouchDataActorUnstaged(void)
+int UtcDaliTouchDataActorUnparented(void)
{
TestApplication application;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
END_TEST;
}
-int UtcDaliTouchDataParentUnstaged(void)
+int UtcDaliTouchDataParentRemovedFromScene(void)
{
TestApplication application;
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
END_TEST;
}
-int UtcDaliTouchDataActorUnstagedDifferentConsumer(void)
+int UtcDaliTouchDataActorRemovedFromSceneDifferentConsumer(void)
{
TestApplication application;
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
int UtcDaliTouchDataInterruptedDifferentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
- Vector2 stageSize = stage.GetSize();
+ Integration::Scene scene = application.GetScene();
+ Vector2 sceneSize = scene.GetSize();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
actor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- stage.Add(actor);
+ scene.Add(actor);
// Render and notify
application.SendNotification();
application.Render();
// Get the camera's near and far planes
- RenderTaskList taskList = stage.GetRenderTaskList();
+ RenderTaskList taskList = scene.GetRenderTaskList();
Dali::RenderTask task = taskList.GetTask(0);
CameraActor camera = task.GetCameraActor();
float nearPlane = camera.GetNearClippingPlane();
// Calculate the current distance of the actor from the camera
float tanHalfFov = tanf(camera.GetFieldOfView() * 0.5f);
- float distance = (stageSize.y * 0.5f) / tanHalfFov;
+ float distance = (sceneSize.y * 0.5f) / tanHalfFov;
// Connect to actor's touched signal
SignalData data;
TouchEventFunctor functor( data );
actor.TouchedSignal().Connect( &application, functor );
- Vector2 screenCoordinates( stageSize.x * 0.5f, stageSize.y * 0.5f );
+ Vector2 screenCoordinates( sceneSize.x * 0.5f, sceneSize.y * 0.5f );
// Emit a down signal
application.ProcessEvent( GenerateSingleTouch( TouchPoint::Down, screenCoordinates ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchInterruptedParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
data.Reset();
rootData.Reset();
- // Remove actor from Stage
- Stage::GetCurrent().Remove( actor );
+ // Remove actor from scene
+ application.GetScene().Remove( actor );
data.Reset();
rootData.Reset();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchLeaveParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
actor.SetProperty( Actor::Property::LEAVE_REQUIRED, false );
// Another motion event outside of root actor, only root signalled
- Vector2 stageSize( Stage::GetCurrent().GetSize() );
- application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( stageSize.width + 10.0f, stageSize.height + 10.0f )) );
+ Vector2 sceneSize( application.GetScene().GetSize() );
+ application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2 ( sceneSize.width + 10.0f, sceneSize.height + 10.0f )) );
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( true, rootData.functorCalled, TEST_LOCATION );
DALI_TEST_EQUALS( TouchPoint::Leave, rootData.touchEvent.points[0].state, TEST_LOCATION );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchActorBecomesInsensitiveParentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
int UtcDaliTouchMultipleLayers(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
// Connect to actor's touched signal
SignalData data;
Layer layer1 ( Layer::New() );
layer1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer1.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer1 );
+ application.GetScene().Add( layer1 );
Actor actor1 ( Actor::New() );
actor1.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer2.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
layer2.SetProperty( Actor::Property::POSITION_Z, 10.0f ); // Should hit layer2 in this layer rather than actor2
- Stage::GetCurrent().Add( layer2 );
+ application.GetScene().Add( layer2 );
Actor actor2 ( Actor::New() );
actor2.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
int UtcDaliTouchMultipleRenderTasks(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(actor);
+ scene.Add(actor);
// Create render task
- Viewport viewport( stageSize.width * 0.5f, stageSize.height * 0.5f, stageSize.width * 0.5f, stageSize.height * 0.5f );
- RenderTask renderTask ( Stage::GetCurrent().GetRenderTaskList().CreateTask() );
+ Viewport viewport( sceneSize.width * 0.5f, sceneSize.height * 0.5f, sceneSize.width * 0.5f, sceneSize.height * 0.5f );
+ RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
renderTask.SetViewport( viewport );
renderTask.SetInputEnabled( true );
int UtcDaliTouchMultipleRenderTasksWithChildLayer(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(actor);
+ scene.Add(actor);
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.Add(layer);
// Create render task
- Viewport viewport( stageSize.width * 0.5f, stageSize.height * 0.5f, stageSize.width * 0.5f, stageSize.height * 0.5f );
- RenderTask renderTask ( Stage::GetCurrent().GetRenderTaskList().CreateTask() );
+ Viewport viewport( sceneSize.width * 0.5f, sceneSize.height * 0.5f, sceneSize.width * 0.5f, sceneSize.height * 0.5f );
+ RenderTask renderTask ( application.GetScene().GetRenderTaskList().CreateTask() );
renderTask.SetViewport( viewport );
renderTask.SetInputEnabled( true );
renderTask.SetSourceActor( actor );
int UtcDaliTouchOffscreenRenderTasks(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
// FrameBuffer for offscreen RenderTask
- FrameBuffer frameBuffer = FrameBuffer::New( stageSize.width, stageSize.height );
+ FrameBuffer frameBuffer = FrameBuffer::New( sceneSize.width, sceneSize.height );
// Create a renderable actor to display the FrameBufferImage
Actor renderableActor = CreateRenderableActor(frameBuffer.GetColorTexture());
renderableActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
- renderableActor.SetProperty( Actor::Property::SIZE, Vector2( stageSize.x, stageSize.y ) );
+ renderableActor.SetProperty( Actor::Property::SIZE, Vector2( sceneSize.x, sceneSize.y ) );
renderableActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
- stage.Add( renderableActor );
+ scene.Add( renderableActor );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add( actor );
+ scene.Add( actor );
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE ); // Ensure framebuffer connects
- stage.GetRenderTaskList().GetTask( 0u ).SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
+ scene.GetRenderTaskList().GetTask( 0u ).SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
// Create a RenderTask
- RenderTask renderTask = stage.GetRenderTaskList().CreateTask();
+ RenderTask renderTask = scene.GetRenderTaskList().CreateTask();
renderTask.SetSourceActor( actor );
renderTask.SetFrameBuffer( frameBuffer );
renderTask.SetInputEnabled( true );
// Create another RenderTask
- RenderTask renderTask2( stage.GetRenderTaskList().CreateTask() );
+ RenderTask renderTask2( scene.GetRenderTaskList().CreateTask() );
renderTask2.SetInputEnabled( true );
// Render and notify
int UtcDaliTouchRenderTaskWithExclusiveActor(void)
{
TestApplication application;
- auto stage = Stage::GetCurrent();
- auto stageSize( stage.GetSize() );
+ auto scene = application.GetScene();
+ auto sceneSize( scene.GetSize() );
auto actor = CreateRenderableActor();
- actor.SetProperty( Actor::Property::SIZE, Vector2( stageSize.x, stageSize.y ) );
- stage.Add( actor );
+ actor.SetProperty( Actor::Property::SIZE, Vector2( sceneSize.x, sceneSize.y ) );
+ scene.Add( actor );
- auto renderTask = stage.GetRenderTaskList().CreateTask();
+ auto renderTask = scene.GetRenderTaskList().CreateTask();
renderTask.SetSourceActor( actor );
renderTask.SetExclusive( true );
int UtcDaliTouchMultipleRenderableActors(void)
{
TestApplication application;
- Stage stage ( Stage::GetCurrent() );
- Vector2 stageSize ( stage.GetSize() );
+ Integration::Scene scene ( application.GetScene() );
+ Vector2 sceneSize ( scene.GetSize() );
Actor parent = CreateRenderableActor();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(parent);
+ scene.Add(parent);
Actor actor = CreateRenderableActor();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
data.Reset();
// Re-add, render and notify
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
DALI_TEST_EQUALS( false, data.functorCalled, TEST_LOCATION );
data.Reset();
- // Re-add actor back to stage, render and notify
- Stage::GetCurrent().Add(actor);
+ // Re-add actor back to scene, render and notify
+ application.GetScene().Add(actor);
application.SendNotification();
application.Render();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
END_TEST;
}
-int UtcDaliTouchActorUnStaged(void)
+int UtcDaliTouchActorRemovedFromScene(void)
{
TestApplication application;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- // Remove actor from stage
- Stage::GetCurrent().Remove( actor );
+ // Remove actor from scene
+ application.GetScene().Remove( actor );
data.Reset();
// Render and notify
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
Layer layer = Layer::New();
layer.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add( layer );
+ application.GetScene().Add( layer );
layer.RaiseToTop();
// Render and notify
int UtcDaliTouchLeaveActorReadded(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene scene = application.GetScene();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- stage.Add(actor);
+ scene.Add(actor);
// Set actor to receive touch-events
actor.SetProperty( Actor::Property::LEAVE_REQUIRED, true );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
data.Reset();
- // Remove actor from stage and add again
- stage.Remove( actor );
- stage.Add( actor );
+ // Remove actor from scene and add again
+ scene.Remove( actor );
+ scene.Add( actor );
// Emit a motion within the actor's bounds
application.ProcessEvent( GenerateSingleTouch( TouchPoint::Motion, Vector2( 12.0f, 10.0f ) ) );
int UtcDaliTouchClippingActor(void)
{
TestApplication application;
- Stage stage = Stage::GetCurrent();
+ Integration::Scene scene = application.GetScene();
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
- stage.Add( actor );
+ scene.Add( actor );
Actor clippingActor = Actor::New();
clippingActor.SetProperty( Actor::Property::SIZE, Vector2( 50.0f, 50.0f ) );
clippingActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
clippingActor.SetProperty( Actor::Property::CLIPPING_MODE, ClippingMode::CLIP_CHILDREN );
- stage.Add( clippingActor );
+ scene.Add( clippingActor );
// Add a child to the clipped region.
Actor clippingChild = Actor::New();
END_TEST;
}
-int UtcDaliTouchActorUnstaged(void)
+int UtcDaliTouchActorUnparented(void)
{
TestApplication application;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
END_TEST;
}
-int UtcDaliTouchParentUnstaged(void)
+int UtcDaliTouchParentRemovedFromScene(void)
{
TestApplication application;
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
END_TEST;
}
-int UtcDaliTouchActorUnstagedDifferentConsumer(void)
+int UtcDaliTouchActorRemovedFromSceneDifferentConsumer(void)
{
TestApplication application;
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
int UtcDaliTouchInterruptedDifferentConsumer(void)
{
TestApplication application;
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
Actor parent = Actor::New();
parent.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
parent.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(parent);
+ application.GetScene().Add(parent);
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
/*
- * 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.
DALI_TEST_CHECK( type );
CameraActor ca = CameraActor::DownCast(type.CreateInstance());
DALI_TEST_CHECK( ca );
- Stage::GetCurrent().Add( ca );
+ application.GetScene().Add( ca );
application.Render();
// animations
DALI_TEST_CHECK( handle );
Actor customActor = Actor::DownCast( handle );
DALI_TEST_CHECK( customActor );
- Stage::GetCurrent().Add(customActor);
+ application.GetScene().Add(customActor);
unsigned int customPropertyCount( customActor.GetPropertyCount() );
DALI_TEST_CHECK( handle );
Actor customActor = Actor::DownCast( handle );
DALI_TEST_CHECK( customActor );
- Stage::GetCurrent().Add(customActor);
+ application.GetScene().Add(customActor);
unsigned int customPropertyCount( customActor.GetPropertyCount() );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Register Type
TypeInfo type;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Register Type
TypeInfo type;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Register Type
TypeInfo type;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Register Type
TypeInfo type;
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Register Type
TypeInfo type;
DALI_TEST_CHECK( handle );
Actor customActor = Actor::DownCast( handle );
DALI_TEST_CHECK( customActor );
- Stage::GetCurrent().Add(customActor);
+ application.GetScene().Add(customActor);
tet_infoline( "Set the value and ensure it changes straight away" );
DALI_TEST_EQUALS( customActor.GetProperty< float >( animatablePropertyIndex ), 0.0f, TEST_LOCATION );
DALI_TEST_CHECK( handle );
Actor customActor = Actor::DownCast( handle );
DALI_TEST_CHECK( customActor );
- Stage::GetCurrent().Add(customActor);
+ application.GetScene().Add(customActor);
tet_infoline( "Get the component values, they should be the default value of the base-property" );
DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
DALI_TEST_CHECK( handle );
Actor customActor = Actor::DownCast( handle );
DALI_TEST_CHECK( customActor );
- Stage::GetCurrent().Add(customActor);
+ application.GetScene().Add(customActor);
tet_infoline( "Get the component values, they should be the default value of the base-property" );
DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
DALI_TEST_CHECK( handle );
Actor customActor = Actor::DownCast( handle );
DALI_TEST_CHECK( customActor );
- Stage::GetCurrent().Add(customActor);
+ application.GetScene().Add(customActor);
tet_infoline( "Get the component values, they should be the default value of the base-property" );
DALI_TEST_EQUALS( customActor.GetProperty< float >( componentZeroPropertyIndex ), 13.0f, TEST_LOCATION );
ChildPropertyRegistration( myCustomTypeInfo.GetName(), "marginSpecification", MARGIN_SPECIFICATION, Property::EXTENTS );
auto customActor = MyTestCustomActor::New();
- Stage::GetCurrent().Add( customActor );
+ application.GetScene().Add( customActor );
auto child = Actor::New();
customActor.Add( child );
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
- Stage::GetCurrent().Add(actor);
+ application.GetScene().Add(actor);
// Render and notify
application.SendNotification();
data.Reset();
// Emit a wheel signal where the actor is not present, will hit the root actor though
- Actor rootActor( Stage::GetCurrent().GetRootLayer() );
+ Actor rootActor( application.GetScene().GetRootLayer() );
// Connect to root actor's wheel event signal
SignalData rootData;
DALI_TEST_EQUALS(1, rootData.receivedWheelEvent.z, TEST_LOCATION); // check modifier
DALI_TEST_EQUALS(1000u, rootData.receivedWheelEvent.timeStamp, TEST_LOCATION); // check modifier
- // Remove actor from stage
- Stage::GetCurrent().Remove( actor );
+ // Remove actor from the scene
+ application.GetScene().Remove( actor );
// Render and notify
application.SendNotification();