/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
#include <stdlib.h>
#include <cmath>
#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/object/handle-devel.h>
#include "dali-test-suite-utils/dali-test-suite-utils.h"
actor.SetType( Dali::Camera::LOOK_AT_TARGET );
DALI_TEST_EQUALS( actor.GetType(), Dali::Camera::LOOK_AT_TARGET, TEST_LOCATION );
- std::string sValue;
- actor.GetProperty( CameraActor::Property::TYPE ).Get( sValue );
- std::string result( "LOOK_AT_TARGET");
- DALI_TEST_EQUALS( result, sValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( "LOOK_AT_TARGET", actor.GetProperty< std::string >( CameraActor::Property::TYPE ), TEST_LOCATION );
+ DALI_TEST_EQUALS( "LOOK_AT_TARGET", DevelHandle::GetCurrentProperty< std::string >( actor, CameraActor::Property::TYPE ), TEST_LOCATION );
END_TEST;
}
END_TEST;
}
-//todor
int UtcDaliCameraActorSetAspectRatioP(void)
{
TestApplication application;
BufferImage image = CreateBufferImage();
- ImageActor actor = ImageActor::New( image );
+ Actor actor = CreateRenderableActor(image);
actor.SetSize( 100.0f, 100.0f );
actor.SetPosition( 20.0f, 30.0f, 40.0f );
actor.SetParentOrigin( ParentOrigin::CENTER );
application.Render();
application.SendNotification();
Image image = CreateBufferImage();
- ImageActor imageActor = ImageActor::New( image );
- imageActor.SetSize( 100.0f, 100.0f );
- Stage::GetCurrent().Add( imageActor );
+ Actor actor = CreateRenderableActor( image, RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE );
+ actor.SetSize( 100.0f, 100.0f );
+ Stage::GetCurrent().Add( actor );
Matrix projectionMatrix;
Matrix viewMatrix;
camera.GetProperty( CameraActor::CameraActor::Property::PROJECTION_MATRIX ).Get( projectionMatrix );
camera.GetProperty( CameraActor::CameraActor::Property::VIEW_MATRIX ).Get( viewMatrix );
- ShaderEffect shaderEffect = ShaderEffect::New( RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE );
- imageActor.SetShaderEffect( shaderEffect );
-
- shaderEffect.SetUniform( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME, Matrix::IDENTITY );
- shaderEffect.SetUniform( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME, Matrix::IDENTITY );
+ actor.RegisterProperty( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME, Matrix::IDENTITY );
+ actor.RegisterProperty( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME, Matrix::IDENTITY );
- Property::Index projectionMatrixPropertyIndex = shaderEffect.GetPropertyIndex( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME );
- Property::Index viewMatrixPropertyIndex = shaderEffect.GetPropertyIndex( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME );
+ Property::Index projectionMatrixPropertyIndex = actor.GetPropertyIndex( SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME );
+ Property::Index viewMatrixPropertyIndex = actor.GetPropertyIndex( SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME );
- Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( shaderEffect, projectionMatrixPropertyIndex, EqualToConstraint() );
+ Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( actor, projectionMatrixPropertyIndex, EqualToConstraint() );
projectionMatrixConstraint.AddSource( Source( camera, CameraActor::Property::PROJECTION_MATRIX ) );
- Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( shaderEffect, viewMatrixPropertyIndex, EqualToConstraint() );
+ Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( actor, viewMatrixPropertyIndex, EqualToConstraint() );
viewMatrixConstraint.AddSource( Source( camera, CameraActor::Property::VIEW_MATRIX ) );
projectionMatrixConstraint.Apply();