-#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 <dali/public-api/object/ref-object.h>
#include <dali/public-api/actors/camera-actor.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/actors/actor-declarations.h>
-#include <dali/internal/event/actor-attachments/actor-attachment-declarations.h>
namespace Dali
{
namespace Internal
{
+namespace SceneGraph
+{
+class Camera;
+}
+
/**
- * An actor with a conveniently pre-attached CameraAttachment.
+ * An actor with Camera.
*/
class CameraActor : public Actor
{
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
/**
* @copydoc Dali::CameraActor::GetFieldOfView
*/
- float GetFieldOfView( ) const;
+ float GetFieldOfView() const;
/**
* @copydoc Dali::CameraActor::SetAspectRatio
/**
* @copydoc Dali::CameraActor::GetAspectRatio
*/
- float GetAspectRatio( ) const;
+ float GetAspectRatio() const;
/**
* @copydoc Dali::CameraActor::SetNearClippingPlane
/**
* @copydoc Dali::CameraActor::GetNearClippingPlane
*/
- float GetNearClippingPlane( ) const;
+ float GetNearClippingPlane() const;
/**
* @copydoc Dali::CameraActor::SetFarClippingPlane
/**
* @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
*/
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
} // namespace Dali
-#endif // __DALI_INTERNAL_CAMERA_ACTOR_H__
+#endif // DALI_INTERNAL_CAMERA_ACTOR_H