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/controls/model/model.h>
22 #include <dali-scene3d/internal/controls/model/model-impl.h>
23 #include <dali-scene3d/public-api/model-components/model-node.h>
33 Model::Model(const Model& model) = default;
35 Model::Model(Model&& rhs) noexcept = default;
37 Model& Model::operator=(const Model& model) = default;
39 Model& Model::operator=(Model&& rhs) noexcept = default;
45 Model Model::New(const std::string& modelUrl, const std::string& resourceDirectoryUrl)
47 return Internal::Model::New(modelUrl, resourceDirectoryUrl);
50 Model Model::DownCast(BaseHandle handle)
52 return Control::DownCast<Model, Internal::Model>(handle);
55 Model::Model(Internal::Model& implementation)
56 : Control(implementation)
60 Model::Model(Dali::Internal::CustomActor* internal)
63 VerifyCustomActorPointer<Internal::Model>(internal);
66 const ModelNode Model::GetModelRoot() const
68 return GetImpl(*this).GetModelRoot();
71 void Model::AddModelNode(ModelNode modelNode)
73 return GetImpl(*this).AddModelNode(modelNode);
76 void Model::RemoveModelNode(ModelNode modelNode)
78 return GetImpl(*this).RemoveModelNode(modelNode);
81 void Model::SetChildrenSensitive(bool enable)
83 GetImpl(*this).SetChildrenSensitive(enable);
86 bool Model::GetChildrenSensitive() const
88 return GetImpl(*this).GetChildrenSensitive();
91 void Model::SetChildrenFocusable(bool enable)
93 GetImpl(*this).SetChildrenFocusable(enable);
96 bool Model::GetChildrenFocusable() const
98 return GetImpl(*this).GetChildrenFocusable();
101 void Model::SetImageBasedLightSource(const std::string& diffuseUrl, const std::string& specularUrl, float scaleFactor)
103 GetImpl(*this).SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
106 void Model::SetImageBasedLightScaleFactor(float scaleFactor)
108 GetImpl(*this).SetImageBasedLightScaleFactor(scaleFactor);
111 float Model::GetImageBasedLightScaleFactor() const
113 return GetImpl(*this).GetImageBasedLightScaleFactor();
116 uint32_t Model::GetAnimationCount() const
118 return GetImpl(*this).GetAnimationCount();
121 Dali::Animation Model::GetAnimation(uint32_t index) const
123 return GetImpl(*this).GetAnimation(index);
126 Dali::Animation Model::GetAnimation(const std::string& name) const
128 return GetImpl(*this).GetAnimation(name);
131 uint32_t Model::GetCameraCount() const
133 return GetImpl(*this).GetCameraCount();
136 Dali::CameraActor Model::GenerateCamera(uint32_t index) const
138 return GetImpl(*this).GenerateCamera(index);
141 bool Model::ApplyCamera(uint32_t index, Dali::CameraActor camera) const
143 return GetImpl(*this).ApplyCamera(index, camera);
146 ModelNode Model::FindChildModelNodeByName(std::string_view nodeName)
148 return GetImpl(*this).FindChildModelNodeByName(nodeName);
151 void Model::RetrieveBlendShapeNames(std::vector<std::string>& blendShapeNames) const
153 GetImpl(*this).RetrieveBlendShapeNames(blendShapeNames);
156 void Model::RetrieveModelNodesByBlendShapeName(std::string_view blendShapeName, std::vector<ModelNode>& modelNodes) const
158 GetImpl(*this).RetrieveModelNodesByBlendShapeName(blendShapeName, modelNodes);
161 Dali::Animation Model::GenerateMotionDataAnimation(MotionData motionData)
163 return GetImpl(*this).GenerateMotionDataAnimation(motionData);
166 void Model::SetMotionData(MotionData motionData)
168 GetImpl(*this).SetMotionData(motionData);
171 } // namespace Scene3D