2 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-scene3d/public-api/model-motion/motion-data.h>
22 #include <dali-scene3d/internal/model-motion/motion-data-impl.h>
28 MotionData MotionData::New()
30 Internal::MotionDataPtr internal = Internal::MotionData::New();
32 return MotionData(internal.Get());
35 MotionData MotionData::New(float durationSeconds)
37 Internal::MotionDataPtr internal = Internal::MotionData::New();
39 internal->SetDuration(durationSeconds);
41 return MotionData(internal.Get());
44 MotionData::MotionData()
48 MotionData::MotionData(const MotionData& motionData) = default;
50 MotionData::MotionData(MotionData&& rhs) noexcept = default;
52 MotionData::~MotionData()
56 MotionData& MotionData::operator=(const MotionData& handle) = default;
58 MotionData& MotionData::operator=(MotionData&& rhs) noexcept = default;
60 MotionData MotionData::DownCast(BaseHandle handle)
62 return MotionData(dynamic_cast<Dali::Scene3D::Internal::MotionData*>(handle.GetObjectPtr()));
65 MotionData::MotionData(Dali::Scene3D::Internal::MotionData* internal)
66 : BaseHandle(internal)
72 uint32_t MotionData::GetMotionCount() const
74 return GetImplementation(*this).GetMotionCount();
77 MotionIndex MotionData::GetIndex(uint32_t index) const
79 return GetImplementation(*this).GetIndex(index);
82 MotionValue MotionData::GetValue(uint32_t index) const
84 return GetImplementation(*this).GetValue(index);
87 void MotionData::Add(MotionIndex index, MotionValue value)
89 GetImplementation(*this).Add(index, value);
92 void MotionData::Clear()
94 GetImplementation(*this).Clear();
97 void MotionData::SetDuration(float durationSeconds)
99 GetImplementation(*this).SetDuration(durationSeconds);
102 float MotionData::GetDuration() const
104 return GetImplementation(*this).GetDuration();
107 void MotionData::LoadBvh(const std::string& path, const Vector3& scale, bool synchronousLoad)
109 GetImplementation(*this).LoadBvh(path, false, scale, synchronousLoad);
112 void MotionData::LoadBvh(const std::string& path, bool useRootTranslationOnly, const Vector3& scale, bool synchronousLoad)
114 GetImplementation(*this).LoadBvh(path, useRootTranslationOnly, scale, synchronousLoad);
117 void MotionData::LoadBvhFromBuffer(const uint8_t* rawBuffer, int rawBufferLength, const Vector3& scale, bool synchronousLoad)
119 GetImplementation(*this).LoadBvhFromBuffer(rawBuffer, rawBufferLength, false, scale, synchronousLoad);
122 void MotionData::LoadBvhFromBuffer(const uint8_t* rawBuffer, int rawBufferLength, bool useRootTranslationOnly, const Vector3& scale, bool synchronousLoad)
124 GetImplementation(*this).LoadBvhFromBuffer(rawBuffer, rawBufferLength, useRootTranslationOnly, scale, synchronousLoad);
127 void MotionData::LoadFacialAnimation(const std::string& url, bool synchronousLoad)
129 GetImplementation(*this).LoadFacialAnimation(url, synchronousLoad);
132 void MotionData::LoadFacialAnimationFromBuffer(const uint8_t* rawBuffer, int rawBufferLength, bool synchronousLoad)
134 GetImplementation(*this).LoadFacialAnimationFromBuffer(rawBuffer, rawBufferLength, synchronousLoad);
137 MotionData::LoadCompletedSignalType& MotionData::LoadCompletedSignal()
139 return GetImplementation(*this).LoadCompletedSignal();
142 } // namespace Scene3D