Revert "[Tizen] Add log if destroyed visual get some signal"
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / model-loader.h
1 #ifndef DALI_SCENE3D_LOADER_MODEL_LOADER_H
2 #define DALI_SCENE3D_LOADER_MODEL_LOADER_H
3 /*
4  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 // INTERNAL INCLUDES
21 #include <dali-scene3d/public-api/api.h>
22 #include <dali-scene3d/public-api/loader/load-result.h>
23 #include <dali-scene3d/public-api/loader/scene-definition.h>
24
25 // EXTERNAL INCLUDES
26 #include <string>
27
28 namespace Dali::Scene3D::Loader
29 {
30 namespace Internal
31 {
32 class ModelLoaderImpl;
33 }
34
35 class DALI_SCENE3D_API ModelLoader
36 {
37 public:
38   class InputParameter
39   {
40   };
41
42   /**
43    * @brief ModelLoader Constructor.
44    * @param[in] modelUrl Url of the model file to be loaded
45    * @param[in] resourceDirectoryUrl Url of directory that contains resources.
46    * @param[out] loadResult Loaded result that includes scene tree and resources.
47    */
48   ModelLoader(const std::string& modelUrl, const std::string& resourceDirectoryUrl, Dali::Scene3D::Loader::LoadResult& loadResult);
49
50   /**
51    * @brief Request to load model from model url.
52    * @param[in] pathProvider Path provider that defines resource paths.
53    * @param[in] loadOnlyRawResource If true, load Raw resource only, and do not create Dali::Handle
54    * If false, this loader load Raw resource and create Dali::Handle too.
55    * Default value is false;
56    * @return True if model loading is successfully finished.
57    */
58   bool LoadModel(Dali::Scene3D::Loader::ResourceBundle::PathProvider& pathProvider, bool loadOnlyRawResource = false);
59
60   /**
61    * @brief Set InputParameter.
62    * Thie method store only a pointer of InputParameter.
63    * The object of InputParameter should not be deleted until it is no longer used.
64    * @param[in] inputParameter Input parameters that can be used in loading time.
65    */
66   void SetInputParameter(InputParameter& inputParameter);
67
68   /**
69    * @brief Retrieves loaded scene
70    * @return SceneDefinition that is loaded from file
71    */
72   Dali::Scene3D::Loader::SceneDefinition& GetScene();
73
74   /**
75    * @brief Retrieves resource bundle that includes resource information
76    * @return ResourceBundle for model resources
77    */
78   Dali::Scene3D::Loader::ResourceBundle& GetResources();
79
80   /**
81    * @brief Retrieves loaded AnimationDefinition
82    * @return AnimationDefinition that is loaded from file
83    */
84   std::vector<Dali::Scene3D::Loader::AnimationDefinition>& GetAnimations();
85
86   /**
87    * @brief Retrieves loaded CameraParameters
88    * @return CameraParameters list that is loaded from file
89    */
90   std::vector<Dali::Scene3D::Loader::CameraParameters>& GetCameras();
91
92   /**
93    * @brief Retrieves ResourceChoices
94    * @return Choices for loaded Resources
95    */
96   Dali::Scene3D::Loader::Customization::Choices& GetResourceChoices();
97
98 private:
99   /**
100    * @brief Create model loader for each file format.
101    */
102   void CreateModelLoader();
103
104   /**
105    * @brief Load resource of the model.
106    */
107   void LoadResource(Dali::Scene3D::Loader::ResourceBundle::PathProvider& pathProvider, bool loadOnlyRawResource);
108
109 private:
110   std::string mModelUrl;
111   std::string mResourceDirectoryUrl;
112
113   Dali::Scene3D::Loader::LoadResult             mLoadResult;
114   Dali::Scene3D::Loader::Customization::Choices mResourceChoices;
115
116   std::shared_ptr<Internal::ModelLoaderImpl> mImpl;
117 };
118 } // namespace Dali::Scene3D::Loader
119
120 #endif // DALI_SCENE3D_LOADER_MODEL_LOADER_H