1 #ifndef DALI_SCENE3D_MODEL_MOTION_MOTION_DATA_LOAD_TASK_H
2 #define DALI_SCENE3D_MODEL_MOTION_MOTION_DATA_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.
22 #include <dali/public-api/adaptor-framework/async-task-manager.h>
25 #include <dali-scene3d/public-api/loader/animation-definition.h>
26 #include <dali-scene3d/public-api/model-motion/motion-data.h>
34 class MotionDataLoadTask;
35 typedef IntrusivePtr<MotionDataLoadTask> MotionDataLoadTaskPtr;
38 * @brief AsyncTask for load MotionData from various type.
39 * After load finished, it will keep result as Loader::AnimationDefinition.
41 class MotionDataLoadTask : public AsyncTask
54 * Constructor for load bvh from file.
56 MotionDataLoadTask(const std::string& path, bool useRootTranslationOnly, const Vector3& scale, CallbackBase* callback);
59 * Constructor for load bvh from buffer.
61 MotionDataLoadTask(const uint8_t* rawBuffer, int rawBufferLength, bool useRootTranslationOnly, const Vector3& scale, CallbackBase* callback);
64 * Constructor for load facial from file.
66 MotionDataLoadTask(const std::string& url, CallbackBase* callback);
69 * Constructor for load facial from buffer.
71 MotionDataLoadTask(const uint8_t* rawBuffer, int rawBufferLength, CallbackBase* callback);
76 ~MotionDataLoadTask();
78 public: // Implementation of AsyncTask
80 * @copydoc Dali::AsyncTask::Process()
85 * @copydoc Dali::AsyncTask::IsReady()
90 * @copydoc Dali::AsyncTask::GetTaskName()
92 std::string_view GetTaskName() const override
94 return "MotionDataLoadTask";
98 const Scene3D::Loader::AnimationDefinition& GetAnimationDefinition() const;
102 MotionDataLoadTask(const MotionDataLoadTask& task) = delete;
105 MotionDataLoadTask& operator=(const MotionDataLoadTask& task) = delete;
108 std::string mFileUrl;
110 int mRawBufferLength;
112 bool mUseRootTranslationOnly;
114 Scene3D::Loader::AnimationDefinition mAnimationDefinition;
115 LoadMethod mLoadMethod;
118 } // namespace Internal
120 } // namespace Scene3D
124 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_DATA_LOAD_TASK_H