X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Fcamera-actor-impl.h;h=faeb53fa639d639970a4c02fcc38a478ee4b3b82;hb=d353bae63798f48237dc24c078c2e8cb2aa0bc62;hp=3cd8d599ff20e250174063a12dece11e63f600f9;hpb=74163ac771df854a011bd32835f92c29cc53626f;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/actors/camera-actor-impl.h b/dali/internal/event/actors/camera-actor-impl.h index 3cd8d59..faeb53f 100644 --- a/dali/internal/event/actors/camera-actor-impl.h +++ b/dali/internal/event/actors/camera-actor-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_CAMERA_ACTOR_H__ -#define __DALI_INTERNAL_CAMERA_ACTOR_H__ +#ifndef DALI_INTERNAL_CAMERA_ACTOR_H +#define DALI_INTERNAL_CAMERA_ACTOR_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -19,11 +19,9 @@ */ // INTERNAL INCLUES -#include #include #include #include -#include namespace Dali { @@ -31,8 +29,13 @@ namespace Dali namespace Internal { +namespace SceneGraph +{ +class Camera; +} + /** - * An actor with a conveniently pre-attached CameraAttachment. + * An actor with Camera. */ class CameraActor : public Actor { @@ -50,18 +53,23 @@ public: static CameraActorPtr New( const Size& size ); /** - * @copydoc Dali::Actor::OnInitialize + * Sets the reflection plane for the camera + * + * @param[in] plane Plane parameters + * + * @note plane.xyz are normal vector of the plane. */ - void OnInitialize(); + void SetReflectByPlane( const Vector4& plane ); /** - * Retrieve the camera attachment. - * @return The attachment. + * @copydoc Dali::CameraActor::SetTargetPosition */ - CameraAttachment& GetCameraAttachment() - { - return *mCameraAttachment; - } + void SetTarget( const Vector3& targetPosition ); + + /** + * @copydoc Dali::CameraActor::GetTargetPosition + */ + Vector3 GetTarget() const; /** * @copydoc Dali::CameraActor::SetType @@ -91,7 +99,7 @@ public: /** * @copydoc Dali::CameraActor::GetFieldOfView */ - float GetFieldOfView( ) const; + float GetFieldOfView() const; /** * @copydoc Dali::CameraActor::SetAspectRatio @@ -101,7 +109,7 @@ public: /** * @copydoc Dali::CameraActor::GetAspectRatio */ - float GetAspectRatio( ) const; + float GetAspectRatio() const; /** * @copydoc Dali::CameraActor::SetNearClippingPlane @@ -111,7 +119,7 @@ public: /** * @copydoc Dali::CameraActor::GetNearClippingPlane */ - float GetNearClippingPlane( ) const; + float GetNearClippingPlane() const; /** * @copydoc Dali::CameraActor::SetFarClippingPlane @@ -121,22 +129,32 @@ public: /** * @copydoc Dali::CameraActor::GetFarClippingPlane */ - float GetFarClippingPlane( ) const; + float GetFarClippingPlane() const; /** - * @copydoc Dali::CameraActor::SetTargetPosition + * @param leftClippingPlane to use */ - void SetTargetPosition( const Vector3& targetPosition ); + void SetLeftClippingPlane( float leftClippingPlane ); /** - * @copydoc Dali::CameraActor::GetTargetPosition + * @param rightClippingPlane to use + */ + void SetRightClippingPlane( float rightClippingPlane ); + + /** + * @param topClippingPlane to use */ - Vector3 GetTargetPosition() const; + void SetTopClippingPlane( float topClippingPlane ); + + /** + * @param bottomClippingPlane to use + */ + void SetBottomClippingPlane( float bottomClippingPlane ); /** * @copydoc Dali::CameraActor::SetInvertYAxis */ - void SetInvertYAxis(bool invertYAxis); + void SetInvertYAxis( bool invertYAxis ); /** * @copydoc Dali::CameraActor::GetCurrentInvertYAxis @@ -145,9 +163,8 @@ public: /** * @copydoc Dali::CameraActor::SetPerspectiveProjection() - * @param[in] stereoBias The frustum horizontal and vertical offset for stereoscopic cameras */ - void SetPerspectiveProjection( const Size& size, const Vector2& stereoBias = Vector2::ZERO ); + void SetPerspectiveProjection( const Size& size ); /** * @copydoc Dali::CameraActor::SetOrthographicProjection(const Vector2& size); @@ -181,83 +198,82 @@ public: */ const Matrix& GetProjectionMatrix() const; -public: // properties - /** - * copydoc Dali::Internal::Object + * Return the scene graph camera (for RenderTask) + * @return The scene graph camera. */ - virtual unsigned int GetDefaultPropertyCount() const; + const SceneGraph::Camera* GetCamera() const; /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices() + * Rotate the projection. + * It is used in case that the target buffer direction is different from the window direction. + * @param [in] rotationAngle The rotation angle */ - virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const; + void RotateProjection( int rotationAngle ); - /** - * copydoc Dali::Internal::Object - */ - virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const; +public: // properties /** - * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput() + * copydoc Dali::Internal::Object::SetDefaultProperty() */ - virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const; + virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ); /** - * copydoc Dali::Internal::Object + * copydoc Dali::Internal::Object::GetDefaultProperty() */ - virtual Property::Type GetDefaultPropertyType( Property::Index index ) const; + virtual Property::Value GetDefaultProperty( Property::Index index ) const; /** - * copydoc Dali::Internal::Object + * copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue() */ - virtual const char* GetDefaultPropertyName( Property::Index index ) const; + virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const; /** - * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex() + * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty() */ - virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const; + virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const; - /** - * copydoc Dali::Internal::Object - */ - virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ); +private: /** - * copydoc Dali::Internal::Object + * Constructor; see also CameraActor::New() + * @param node the scene graph node */ - virtual Property::Value GetDefaultProperty( Property::Index index ) const; + CameraActor( const SceneGraph::Node& node ); /** - * copydoc Dali::Internal::Object + * A reference counted object may only be deleted by calling Unreference() */ - virtual bool IsDefaultPropertyWritable( Property::Index index ) const ; + virtual ~CameraActor(); - /** - * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty() - */ - virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const; /** - * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty() + * @copydoc Dali::Internal::Actor::OnInitialize() */ - virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const; - -protected: + void OnInitialize() override; /** - * Protected constructor; see also CameraActor::New() + * @copydoc Dali::Internal::Actor::OnStageConnectionInternal() */ - CameraActor(); + void OnStageConnectionInternal() override; - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~CameraActor(); +private: // Data -private: + const SceneGraph::Camera* mSceneObject; ///< Not owned - CameraAttachmentPtr mCameraAttachment; + Vector3 mTarget; + Vector2 mCanvasSize; + Dali::Camera::Type mType; + Dali::Camera::ProjectionMode mProjectionMode; + float mFieldOfView; + float mAspectRatio; + float mNearClippingPlane; + float mFarClippingPlane; + float mLeftClippingPlane; + float mRightClippingPlane; + float mTopClippingPlane; + float mBottomClippingPlane; + bool mInvertYAxis; }; @@ -285,4 +301,4 @@ inline const Internal::CameraActor& GetImplementation(const Dali::CameraActor& c } // namespace Dali -#endif // __DALI_INTERNAL_CAMERA_ACTOR_H__ +#endif // DALI_INTERNAL_CAMERA_ACTOR_H