Deprecate Plane Distance setter + Implement OrthographicSize + Animatable AspectRatio
[platform/core/uifw/dali-core.git] / dali / public-api / actors / camera-actor.h
index 36cfeef..754b70e 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_CAMERA_ACTOR_H__
-#define __DALI_CAMERA_ACTOR_H__
+#ifndef DALI_CAMERA_ACTOR_H
+#define DALI_CAMERA_ACTOR_H
 
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -54,8 +54,8 @@ enum Type
  */
 enum ProjectionMode
 {
-  PERSPECTIVE_PROJECTION,    ///< Distance causes foreshortening; objects further from the camera appear smaller @SINCE_1_0.0
-  ORTHOGRAPHIC_PROJECTION,    ///< Relative distance from the camera does not affect the size of objects @SINCE_1_0.0
+  PERSPECTIVE_PROJECTION,  ///< Distance causes foreshortening; objects further from the camera appear smaller @SINCE_1_0.0
+  ORTHOGRAPHIC_PROJECTION, ///< Relative distance from the camera does not affect the size of objects @SINCE_1_0.0
 };
 
 } // namespace Camera
@@ -89,7 +89,6 @@ enum ProjectionMode
 class DALI_CORE_API CameraActor : public Actor
 {
 public:
-
   /**
    * @brief Enumeration for the instance of properties belonging to the CameraActor class.
    *
@@ -135,7 +134,8 @@ public:
   /**
    * @brief Creates a CameraActor object.
    *
-   * @note No default camera perspective projection is set by this method. @see SetPerspectiveProjection().
+   * @note Sets the default camera perspective projection for the size of the scene this is added to. @see SetPerspectiveProjection().
+   * @note When this actor gets added to a scene, then it's Z position will be modified according to the required perspective projection.
    *
    * @SINCE_1_0.0
    * @return The newly created camera actor
@@ -151,7 +151,7 @@ public:
    * @param[in] size The canvas size
    * @return The newly created camera actor
    */
-  static CameraActor New( const Size& size );
+  static CameraActor New(const Size& size);
 
   /**
    * @brief Downcasts a handle to CameraActor handle.
@@ -162,7 +162,7 @@ public:
    * @param[in] handle to An object
    * @return Handle to a CameraActor or an uninitialized handle
    */
-  static CameraActor DownCast( BaseHandle handle );
+  static CameraActor DownCast(BaseHandle handle);
 
   /**
    * @brief Destructor.
@@ -195,7 +195,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] type The camera type
    */
-  void SetType( Dali::Camera::Type type );
+  void SetType(Dali::Camera::Type type);
 
   /**
    * @brief Gets the type of the camera.
@@ -211,7 +211,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] mode One of PERSPECTIVE_PROJECTION or ORTHOGRAPHIC_PROJECTION
    */
-  void SetProjectionMode( Dali::Camera::ProjectionMode mode );
+  void SetProjectionMode(Dali::Camera::ProjectionMode mode);
 
   /**
    * @brief Gets the projection mode.
@@ -223,11 +223,12 @@ public:
 
   /**
    * @brief Sets the field of view.
+   * Field of view will be used when ProjectionMode is PERSPECTIVE_PROJECTION.
    *
    * @SINCE_1_0.0
    * @param[in] fieldOfView The field of view in radians
    */
-  void SetFieldOfView( float fieldOfView );
+  void SetFieldOfView(float fieldOfView);
 
   /**
    * @brief Gets the field of view in Radians.
@@ -236,7 +237,7 @@ public:
    * @SINCE_1_0.0
    * @return The field of view in radians
    */
-  float GetFieldOfView( );
+  float GetFieldOfView();
 
   /**
    * @brief Sets the aspect ratio.
@@ -244,7 +245,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] aspectRatio The aspect ratio
    */
-  void SetAspectRatio( float aspectRatio );
+  void SetAspectRatio(float aspectRatio);
 
   /**
    * @brief Gets the aspect ratio of the camera.
@@ -253,7 +254,7 @@ public:
    * @SINCE_1_0.0
    * @return The aspect ratio
    */
-  float GetAspectRatio( );
+  float GetAspectRatio();
 
   /**
    * @brief Sets the near clipping plane distance.
@@ -261,7 +262,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] nearClippingPlane Distance of the near clipping plane
    */
-  void SetNearClippingPlane( float nearClippingPlane );
+  void SetNearClippingPlane(float nearClippingPlane);
 
   /**
    * @brief Gets the near clipping plane distance.
@@ -271,7 +272,7 @@ public:
    * @SINCE_1_0.0
    * @return The near clipping plane value
    */
-  float GetNearClippingPlane( );
+  float GetNearClippingPlane();
 
   /**
    * @brief Sets the far clipping plane distance.
@@ -279,7 +280,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] farClippingPlane Distance of the far clipping plane
    */
-  void SetFarClippingPlane( float farClippingPlane );
+  void SetFarClippingPlane(float farClippingPlane);
 
   /**
    * @brief Gets the far clipping plane distance.
@@ -288,7 +289,7 @@ public:
    * @SINCE_1_0.0
    * @return The far clipping plane value
    */
-  float GetFarClippingPlane( );
+  float GetFarClippingPlane();
 
   /**
    * @brief Sets the target position of the camera.
@@ -297,7 +298,7 @@ public:
    * @param[in] targetPosition The position of the target to look at
    * @pre Camera type is LOOK_AT_TARGET.
    */
-  void SetTargetPosition( const Vector3& targetPosition );
+  void SetTargetPosition(const Vector3& targetPosition);
 
   /**
    * @brief Gets the Camera Target position.
@@ -332,13 +333,15 @@ public:
    * Sets the near and far clipping planes, the field of view, the aspect ratio,
    * and the Z position of the actor based on the canvas size so that 1 unit in
    * XY (z=0) plane is 1 pixel on screen.
+   * Also, It will set orthographic size be fitted as XY plane.
    *
    * @SINCE_1_0.0
    * @param[in] size The canvas size
    * @pre The canvas size must be greater than zero.
-   *
+   * @note If either of the values of size is 0.0f, then we use the default perspective projection for the size of the scene this actor is added to.
+   * @note This modifies the Z position property of this actor as well.
    */
-  void SetPerspectiveProjection( const Size& size );
+  void SetPerspectiveProjection(const Size& size);
 
   /**
    * @brief Sets the camera projection to use orthographic projection.
@@ -354,22 +357,7 @@ public:
    * @SINCE_1_0.0
    * @param[in] size Size of XY plane (normal to camera axis)
    */
-  void SetOrthographicProjection( const Size& size );
-
-  /**
-   * @brief Sets the camera projection to use orthographic projection with the given clip planes.
-   *
-   * This does not change the Z value of the camera actor.
-   *
-   * @SINCE_1_0.0
-   * @param[in] left Distance to left clip plane (normal to camera axis)
-   * @param[in] right Distance to right clip plane (normal to camera axis)
-   * @param[in] top Distance to top clip plane (normal to camera axis)
-   * @param[in] bottom Distance to bottom clip plane (normal to camera axis)
-   * @param[in] near Distance to the near clip plane (along camera axis)
-   * @param[in] far Distance to the far clip plane (along camera axis)
-   */
-  void SetOrthographicProjection( float left, float right, float top, float bottom, float near, float far );
+  void SetOrthographicProjection(const Size& size);
 
 public: // Not intended for use by Application developers
   /// @cond internal
@@ -388,4 +376,4 @@ public: // Not intended for use by Application developers
  */
 } // namespace Dali
 
-#endif // __DALI_CAMERA_ACTOR_H__
+#endif // DALI_CAMERA_ACTOR_H