[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / controls / model / model.h
index b3c5ab3..88bc524 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_SCENE3D_MODEL_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -56,6 +56,8 @@ class Model;
  *
  * By default, The loaded model has its own position and size which are defined in vertex buffer regardless of the Control size.
  *
+ * @note We support to render model well only if glsl version is higher than 300.
+ *
  * @SINCE_2_1.41
  * @code
  *
@@ -75,7 +77,7 @@ class DALI_SCENE3D_API Model : public Dali::Toolkit::Control
 {
 public:
   // Typedefs
-  using MeshHitSignalType = Signal<bool(Model, Scene3D::ModelNode)>; ///< Mesh hit signal type @SINCE_2_2.99 TODO: See what parameters need to be added
+  using MeshHitSignalType = Signal<bool(Model, Scene3D::ModelNode)>; ///< Mesh hit signal type @SINCE_2_2.53
   using ColliderMeshPtr   = std::unique_ptr<Algorithm::NavigationMesh>;
 
   /**
@@ -167,7 +169,7 @@ public:
    * @brief Add new ModelNode to this Model.
    * This modelNode will become child of ModelRoot.
    *
-   * @SINCE_2_2.99
+   * @SINCE_2_2.22
    * @param[in] modelNode the root of ModelNode tree to be added.
    */
   void AddModelNode(ModelNode modelNode);
@@ -175,7 +177,7 @@ public:
   /**
    * @brief Remove ModelNode from this Model.
    *
-   * @SINCE_2_2.99
+   * @SINCE_2_2.22
    * @param[in] modelNode the root of ModelNode tree to be removed.
    */
   void RemoveModelNode(ModelNode modelNode);
@@ -333,7 +335,7 @@ public:
   ModelNode FindChildModelNodeByName(std::string_view nodeName);
 
   /**
-   * @brief Retrieve the list of blendshape name that current Model hold.
+   * @brief Retrieves the list of blendshape name that current Model hold.
    * The name will be appended end of input list.
    *
    * @SINCE_2_2.34
@@ -343,7 +345,7 @@ public:
   void RetrieveBlendShapeNames(std::vector<std::string>& blendShapeNames) const;
 
   /**
-   * @brief Retrieve the list of ModelNode that contains given blend shape name.
+   * @brief Retrieves the list of ModelNode that contains given blend shape name.
    * The ModelNode will be appended end of input list.
    *
    * @SINCE_2_2.34
@@ -354,7 +356,7 @@ public:
   void RetrieveModelNodesByBlendShapeName(std::string_view blendShapeName, std::vector<ModelNode>& modelNodes) const;
 
   /**
-   * @brief Generate specific animation of this Model by inputed MotionData.
+   * @brief Generates specific animation of this Model by inputed MotionData.
    *
    * @SINCE_2_2.34
    * @param[in] motionData the data of motion animation.
@@ -364,7 +366,7 @@ public:
   Dali::Animation GenerateMotionDataAnimation(MotionData motionData);
 
   /**
-   * @brief Set specific values of this Model by inputed MotionData.
+   * @brief Sets specific values of this Model by inputed MotionData.
    * @note If MotionValue's ValueType is ValueType::KEY_FRAMES, the last value will be set.
    *
    * @SINCE_2_2.34
@@ -374,6 +376,45 @@ public:
   void SetMotionData(Scene3D::MotionData motionData);
 
   /**
+   * @brief Sets whether this Model casts shadow or not.
+   * If it is true, this model is drawn on Shadow Map.
+   *
+   * @SINCE_2_3.99
+   * @param[in] castShadow Whether this Model casts shadow or not.
+   * @note This method affects all of the child ModelNode.
+   * However, same property of each child ModelNode can be changed respectively and it not changes parent's property.
+   */
+  void CastShadow(bool castShadow);
+
+  /**
+   * @brief Retrieves whether the Model casts shadow or not for Light.
+   *
+   * @SINCE_2_3.99
+   * @return True if this model casts shadow.
+   * @note IBL does not cast any shadow.
+   */
+  bool IsShadowCasting() const;
+
+  /**
+   * @brief Sets whether this Model receives shadow or not.
+   * If it is true, shadows are drawn on this model.
+   *
+   * @SINCE_2_3.99
+   * @param[in] receiveShadow Whether this Model receives shadow or not.
+   * @note This method affects all of the child ModelNode.
+   * However, same property of each child ModelNode can be changed respectively and it not changes parent's property.
+   */
+  void ReceiveShadow(bool receiveShadow);
+
+  /**
+   * @brief Retrieves whether the Model receives shadow or not for Light.
+   *
+   * @SINCE_2_3.99
+   * @return True if this model receives shadow.
+   */
+  bool IsShadowReceiving() const;
+
+  /**
    * @brief This signal is emitted when the collider mesh is touched/hit.
    *
    * A callback of the following type may be connected:
@@ -385,7 +426,7 @@ public:
    * The return value of True, indicates that the hover event should be consumed.
    * Otherwise the signal will be emitted on the next sensitive parent of the actor.
    *
-   * @SINCE_2_3.0
+   * @SINCE_2_2.53
    * @return The signal to connect to
    */
   MeshHitSignalType& MeshHitSignal();