Compute min/max value if min/max is not defined.
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / controls / model-view / model-view.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-view/model-view.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-scene3d/internal/controls/model-view/model-view-impl.h>
23
24 namespace Dali
25 {
26 namespace Scene3D
27 {
28 ModelView::ModelView()
29 {
30 }
31
32 ModelView::ModelView(const ModelView& modelView) = default;
33
34 ModelView::ModelView(ModelView&& rhs) = default;
35
36 ModelView& ModelView::operator=(const ModelView& modelView) = default;
37
38 ModelView& ModelView::operator=(ModelView&& rhs) = default;
39
40 ModelView::~ModelView()
41 {
42 }
43
44 ModelView ModelView::New(const std::string& modelPath, const std::string& resourcePath)
45 {
46   return Internal::ModelView::New(modelPath, resourcePath);
47 }
48
49 ModelView ModelView::DownCast(BaseHandle handle)
50 {
51   return Control::DownCast<ModelView, Internal::ModelView>(handle);
52 }
53
54 ModelView::ModelView(Internal::ModelView& implementation)
55 : Control(implementation)
56 {
57 }
58
59 ModelView::ModelView(Dali::Internal::CustomActor* internal)
60 : Control(internal)
61 {
62   VerifyCustomActorPointer<Internal::ModelView>(internal);
63 }
64
65 const Actor ModelView::GetModelRoot()
66 {
67   return GetImpl(*this).GetModelRoot();
68 }
69
70 void ModelView::FitSize(bool fit)
71 {
72   GetImpl(*this).FitSize(fit);
73 }
74
75 void ModelView::FitCenter(bool fit)
76 {
77   GetImpl(*this).FitCenter(fit);
78 }
79
80 void ModelView::SetImageBasedLightSource(const std::string& diffuse, const std::string& specular, float scaleFactor)
81 {
82   GetImpl(*this).SetImageBasedLightSource(diffuse, specular, scaleFactor);
83 }
84
85 uint32_t ModelView::GetAnimationCount()
86 {
87   return GetImpl(*this).GetAnimationCount();
88 }
89
90 Dali::Animation ModelView::GetAnimation(uint32_t index)
91 {
92   return GetImpl(*this).GetAnimation(index);
93 }
94
95 Dali::Animation ModelView::GetAnimation(const std::string& name)
96 {
97   return GetImpl(*this).GetAnimation(name);
98 }
99
100 } // namespace Scene3D
101
102 } // namespace Dali