Merge changes I776588c1,I7292a2fb into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / internal / controls / model / model-impl.h
index 52aed7d..b740da4 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali/devel-api/common/map-wrapper.h>
 #include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/animation/animation.h>
@@ -51,8 +52,9 @@ namespace Internal
 class Model : public Dali::Toolkit::Internal::Control, public LightObserver
 {
 public:
-  using AnimationData = std::pair<std::string, Dali::Animation>;
-  using CameraData    = Loader::CameraParameters;
+  using AnimationData          = std::pair<std::string, Dali::Animation>;
+  using CameraData             = Loader::CameraParameters;
+  using BlendShapeModelNodeMap = std::map<std::string, std::vector<Scene3D::ModelNode>>;
 
   /**
    * @copydoc Model::New()
@@ -144,6 +146,26 @@ public:
    */
   Scene3D::ModelNode FindChildModelNodeByName(std::string_view nodeName);
 
+  /**
+   * @copydoc Model::RetrieveBlendShapeNames()
+   */
+  void RetrieveBlendShapeNames(std::vector<std::string>& blendShapeNames) const;
+
+  /**
+   * @copydoc Model::RetrieveModelNodesByBlendShapeName()
+   */
+  void RetrieveModelNodesByBlendShapeName(std::string_view blendShapeName, std::vector<Scene3D::ModelNode>& modelNodes) const;
+
+  /**
+   * @copydoc Model::GenerateMotionDataAnimation()
+   */
+  Dali::Animation GenerateMotionDataAnimation(Scene3D::MotionData motionData);
+
+  /**
+   * @copydoc Model::SetMotionData()
+   */
+  void SetMotionData(Scene3D::MotionData motionData);
+
 protected:
   /**
    * @brief Constructs a new Model.
@@ -250,6 +272,11 @@ private:
 
 public: // Overrides LightObserver Methods.
   /**
+   * @copydoc Dali::Scene3D::Internal::LightObserver::NotifyShadowMapTexture()
+   */
+  void NotifyShadowMapTexture(Dali::Texture shadowMapTexture) override;
+
+  /**
    * @copydoc Dali::Scene3D::Internal::LightObserver::NotifyImageBasedLightTexture()
    */
   void NotifyImageBasedLightTexture(Dali::Texture diffuseTexture, Dali::Texture specularTexture, float scaleFactor, uint32_t specularMipmapLevels) override;
@@ -259,16 +286,6 @@ public: // Overrides LightObserver Methods.
    */
   void NotifyImageBasedLightScaleFactor(float scaleFactor) override;
 
-  /**
-   * @copydoc Dali::Scene3D::Internal::LightObserver::NotifyLightAdded()
-   */
-  void NotifyLightAdded(uint32_t lightIndex, Scene3D::Light light) override;
-
-  /**
-   * @copydoc Dali::Scene3D::Internal::LightObserver::NotifyLightRemoved()
-   */
-  void NotifyLightRemoved(uint32_t lightIndex) override;
-
 private:
   /**
    * @brief Asynchronously model loading finished.
@@ -325,6 +342,11 @@ private:
    */
   void ResetCameraParameters();
 
+  /**
+   * @brief Collect ModelNode list by blendshape name
+   */
+  void UpdateBlendShapeNodeMap();
+
 private:
   std::string                    mModelUrl;
   std::string                    mResourceDirectoryUrl;
@@ -334,14 +356,19 @@ private:
   WeakHandle<Scene3D::SceneView> mParentSceneView;
   Dali::PropertyNotification     mSizeNotification;
 
-  // Light
-  std::vector<Scene3D::Light> mLights;
+  Dali::Scene3D::Loader::ShaderManagerPtr mShaderManager;
+
+  // List of ModelNode for name of blend shape.
+  BlendShapeModelNodeMap mBlendShapeModelNodeMap;
 
   // Asynchronous loading variable
   ModelLoadTaskPtr          mModelLoadTask;
   EnvironmentMapLoadTaskPtr mIblDiffuseLoadTask;
   EnvironmentMapLoadTaskPtr mIblSpecularLoadTask;
 
+  // Shadow
+  Dali::Texture mShadowMapTexture;
+
   std::string mDiffuseIblUrl;
   std::string mSpecularIblUrl;