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();
81 void Process() override;
84 * Whether the task is ready to process.
85 * @return True if the task is ready to process.
87 bool IsReady() override;
90 const Scene3D::Loader::AnimationDefinition& GetAnimationDefinition() const;
94 MotionDataLoadTask(const MotionDataLoadTask& task) = delete;
97 MotionDataLoadTask& operator=(const MotionDataLoadTask& task) = delete;
100 std::string mFileUrl;
102 int mRawBufferLength;
104 bool mUseRootTranslationOnly;
106 Scene3D::Loader::AnimationDefinition mAnimationDefinition;
107 LoadMethod mLoadMethod;
110 } // namespace Internal
112 } // namespace Scene3D
116 #endif // DALI_SCENE3D_MODEL_MOTION_MOTION_DATA_LOAD_TASK_H