X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Fcamera-actor-impl.h;h=2e1e747fe762c9b46a954c0cb883b5543534d487;hb=4b11f4a9e0c1fe08dfe94e2b923d0c6dc03ba511;hp=c7466317869bc58aad139f3c5c32f9105d8a8785;hpb=8f2c5571c924479b6a07a2c2187dedd9c685baf0;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 c746631..2e1e747 100644 --- a/dali/internal/event/actors/camera-actor-impl.h +++ b/dali/internal/event/actors/camera-actor-impl.h @@ -1,28 +1,27 @@ -#ifndef __DALI_INTERNAL_CAMERA_ACTOR_H__ -#define __DALI_INTERNAL_CAMERA_ACTOR_H__ - -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +#ifndef DALI_INTERNAL_CAMERA_ACTOR_H +#define DALI_INTERNAL_CAMERA_ACTOR_H + +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // INTERNAL INCLUES -#include #include #include #include -#include namespace Dali { @@ -30,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 { @@ -49,18 +53,14 @@ public: static CameraActorPtr New( const Size& size ); /** - * @copydoc Dali::Actor::OnInitialize + * @copydoc Dali::CameraActor::SetTargetPosition */ - void OnInitialize(); + void SetTarget( const Vector3& targetPosition ); /** - * Retrieve the camera attachment. - * @return The attachment. + * @copydoc Dali::CameraActor::GetTargetPosition */ - CameraAttachment& GetCameraAttachment() - { - return *mCameraAttachment; - } + Vector3 GetTarget() const; /** * @copydoc Dali::CameraActor::SetType @@ -90,7 +90,7 @@ public: /** * @copydoc Dali::CameraActor::GetFieldOfView */ - float GetFieldOfView( ) const; + float GetFieldOfView() const; /** * @copydoc Dali::CameraActor::SetAspectRatio @@ -100,7 +100,7 @@ public: /** * @copydoc Dali::CameraActor::GetAspectRatio */ - float GetAspectRatio( ) const; + float GetAspectRatio() const; /** * @copydoc Dali::CameraActor::SetNearClippingPlane @@ -110,7 +110,7 @@ public: /** * @copydoc Dali::CameraActor::GetNearClippingPlane */ - float GetNearClippingPlane( ) const; + float GetNearClippingPlane() const; /** * @copydoc Dali::CameraActor::SetFarClippingPlane @@ -120,22 +120,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 */ - Vector3 GetTargetPosition() const; + void SetRightClippingPlane( float rightClippingPlane ); + + /** + * @param topClippingPlane to use + */ + 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 @@ -144,9 +154,8 @@ public: /** * @copydoc Dali::CameraActor::SetPerspectiveProjection() - * @param[in] stereoBias The frustum horizontal offset for stereoscopic cameras */ - void SetPerspectiveProjection( const Size& size, float stereoBias = 0.0f ); + void SetPerspectiveProjection( const Size& size ); /** * @copydoc Dali::CameraActor::SetOrthographicProjection(const Vector2& size); @@ -180,84 +189,83 @@ public: */ const Matrix& GetProjectionMatrix() const; -public: // properties - /** - * copydoc Dali::Internal::ProxyObject + * 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::ProxyObject::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::ProxyObject - */ - virtual bool IsDefaultPropertyAnimatable( Property::Index index ) const; +public: // properties /** - * @copydoc Dali::Internal::ProxyObject::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::ProxyObject + * copydoc Dali::Internal::Object::GetDefaultProperty() */ - virtual Property::Type GetDefaultPropertyType( Property::Index index ) const; + virtual Property::Value GetDefaultProperty( Property::Index index ) const; /** - * copydoc Dali::Internal::ProxyObject + * copydoc Dali::Internal::Object::GetDefaultPropertyCurrentValue() */ - virtual const std::string& GetDefaultPropertyName( Property::Index index ) const; + virtual Property::Value GetDefaultPropertyCurrentValue( Property::Index index ) const; /** - * @copydoc Dali::Internal::ProxyObject::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::ProxyObject - */ - virtual void SetDefaultProperty( Property::Index index, const Property::Value& propertyValue ); +private: /** - * copydoc Dali::Internal::ProxyObject + * 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::ProxyObject + * A reference counted object may only be deleted by calling Unreference() */ - virtual bool IsDefaultPropertyWritable( Property::Index index ) const ; + virtual ~CameraActor(); + /** - * @copydoc Dali::Internal::ProxyObject::GetSceneObjectAnimatableProperty() + * @copydoc Dali::Internal::Actor::OnInitialize() */ - virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const; + void OnInitialize() override; /** - * @copydoc Dali::Internal::ProxyObject::GetSceneObjectInputProperty() + * @copydoc Dali::Internal::Actor::OnStageConnectionInternal() */ - virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const; + void OnStageConnectionInternal() override; -protected: +private: // Data - /** - * Protected constructor; see also CameraActor::New() - */ - CameraActor(); + const SceneGraph::Camera* mSceneObject; ///< Not owned - /** - * A reference counted object may only be deleted by calling Unreference() - */ - virtual ~CameraActor(); + 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; -private: - CameraAttachmentPtr mCameraAttachment; - static bool mFirstInstance ; - static DefaultPropertyLookup* mDefaultCameraActorPropertyLookup; ///< Default properties }; } // namespace Internal @@ -284,4 +292,4 @@ inline const Internal::CameraActor& GetImplementation(const Dali::CameraActor& c } // namespace Dali -#endif // __DALI_INTERNAL_CAMERA_ACTOR_H__ +#endif // DALI_INTERNAL_CAMERA_ACTOR_H