DALi Version 2.2.11
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / controls / model / model.cpp
1 /*
2  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-scene3d/public-api/controls/model/model.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-scene3d/internal/controls/model/model-impl.h>
23
24 namespace Dali
25 {
26 namespace Scene3D
27 {
28 Model::Model()
29 {
30 }
31
32 Model::Model(const Model& model) = default;
33
34 Model::Model(Model&& rhs) = default;
35
36 Model& Model::operator=(const Model& model) = default;
37
38 Model& Model::operator=(Model&& rhs) = default;
39
40 Model::~Model()
41 {
42 }
43
44 Model Model::New(const std::string& modelUrl, const std::string& resourceDirectoryUrl)
45 {
46   return Internal::Model::New(modelUrl, resourceDirectoryUrl);
47 }
48
49 Model Model::DownCast(BaseHandle handle)
50 {
51   return Control::DownCast<Model, Internal::Model>(handle);
52 }
53
54 Model::Model(Internal::Model& implementation)
55 : Control(implementation)
56 {
57 }
58
59 Model::Model(Dali::Internal::CustomActor* internal)
60 : Control(internal)
61 {
62   VerifyCustomActorPointer<Internal::Model>(internal);
63 }
64
65 const Actor Model::GetModelRoot() const
66 {
67   return GetImpl(*this).GetModelRoot();
68 }
69
70 void Model::SetChildrenSensitive(bool enable)
71 {
72   GetImpl(*this).SetChildrenSensitive(enable);
73 }
74
75 bool Model::GetChildrenSensitive() const
76 {
77   return GetImpl(*this).GetChildrenSensitive();
78 }
79
80 void Model::SetChildrenFocusable(bool enable)
81 {
82   GetImpl(*this).SetChildrenFocusable(enable);
83 }
84
85 bool Model::GetChildrenFocusable() const
86 {
87   return GetImpl(*this).GetChildrenFocusable();
88 }
89
90 void Model::SetImageBasedLightSource(const std::string& diffuseUrl, const std::string& specularUrl, float scaleFactor)
91 {
92   GetImpl(*this).SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
93 }
94
95 void Model::SetImageBasedLightTexture(Texture diffuseTexture, Texture specularTexture, float scaleFactor)
96 {
97   GetImpl(*this).SetImageBasedLightTexture(diffuseTexture, specularTexture, scaleFactor);
98 }
99
100 void Model::SetImageBasedLightScaleFactor(float scaleFactor)
101 {
102   GetImpl(*this).SetImageBasedLightScaleFactor(scaleFactor);
103 }
104
105 float Model::GetImageBasedLightScaleFactor() const
106 {
107   return GetImpl(*this).GetImageBasedLightScaleFactor();
108 }
109
110 uint32_t Model::GetAnimationCount() const
111 {
112   return GetImpl(*this).GetAnimationCount();
113 }
114
115 Dali::Animation Model::GetAnimation(uint32_t index) const
116 {
117   return GetImpl(*this).GetAnimation(index);
118 }
119
120 Dali::Animation Model::GetAnimation(const std::string& name) const
121 {
122   return GetImpl(*this).GetAnimation(name);
123 }
124
125 } // namespace Scene3D
126
127 } // namespace Dali