1 #ifndef DALI_SCENE3D_MODEL_LOAD_TASK_H
2 #define DALI_SCENE3D_MODEL_LOAD_TASK_H
5 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <dali/public-api/common/intrusive-ptr.h>
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/images/pixel-data.h>
27 #include <dali-scene3d/internal/common/model-cache-manager.h>
28 #include <dali-scene3d/public-api/loader/load-result.h>
29 #include <dali-scene3d/public-api/loader/scene-definition.h>
30 #include <dali/devel-api/threading/conditional-wait.h>
31 #include <dali/public-api/adaptor-framework/async-task-manager.h>
40 typedef IntrusivePtr<ModelLoadTask> ModelLoadTaskPtr;
42 class ModelLoadTask : public AsyncTask
47 * @param[in] modelUrl Model file path.(e.g., glTF, and DLI).
48 * @param[in] resourceDirectoryUrl Resource file path that includes binary, image etc.
49 * @param[in] callback The callback that is called when the operation is completed.
51 ModelLoadTask(const std::string& modelUrl, const std::string& resourceDirectoryUrl, CallbackBase* callback);
61 void Process() override;
64 * Whether the task is ready to process.
65 * @return True if the task is ready to process.
67 bool IsReady() override;
70 * Whether the task has succeeded.
71 * @return True if the task has succeeded.
73 bool HasSucceeded() const;
77 ModelLoadTask(const ModelLoadTask& task) = delete;
80 ModelLoadTask& operator=(const ModelLoadTask& task) = delete;
83 std::string mModelUrl;
84 std::string mResourceDirectoryUrl;
86 Dali::Scene3D::Loader::Customization::Choices mResourceChoices;
87 Dali::Scene3D::Loader::ResourceRefCounts mResourceRefCount;
90 ModelCacheManager mModelCacheManager;
91 Dali::Scene3D::Loader::LoadResult mLoadResult;
94 } // namespace Internal
96 } // namespace Scene3D
100 #endif // DALI_SCENE3D_MODEL_LOAD_TASK_H