[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / model-motion / motion-index / blend-shape-index.cpp
1 /*
2  * Copyright (c) 2023 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/model-motion/motion-index/blend-shape-index.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-scene3d/internal/model-motion/motion-index/blend-shape-index-impl.h>
23
24 namespace Dali
25 {
26 namespace Scene3D
27 {
28 BlendShapeIndex BlendShapeIndex::New()
29 {
30   Internal::BlendShapeIndexPtr internal = Internal::BlendShapeIndex::New();
31
32   return BlendShapeIndex(internal.Get());
33 }
34
35 BlendShapeIndex BlendShapeIndex::New(Property::Key blendShapeId)
36 {
37   Internal::BlendShapeIndexPtr internal = Internal::BlendShapeIndex::New();
38
39   internal->SetBlendShapeId(blendShapeId);
40
41   return BlendShapeIndex(internal.Get());
42 }
43
44 BlendShapeIndex BlendShapeIndex::New(Property::Key modelNodeId, Property::Key blendShapeId)
45 {
46   Internal::BlendShapeIndexPtr internal = Internal::BlendShapeIndex::New();
47
48   internal->SetModelNodeId(modelNodeId);
49   internal->SetBlendShapeId(blendShapeId);
50
51   return BlendShapeIndex(internal.Get());
52 }
53
54 BlendShapeIndex::BlendShapeIndex()
55 {
56 }
57
58 BlendShapeIndex::BlendShapeIndex(const BlendShapeIndex& blendShapeIndex) = default;
59
60 BlendShapeIndex::BlendShapeIndex(BlendShapeIndex&& rhs) noexcept = default;
61
62 BlendShapeIndex::~BlendShapeIndex()
63 {
64 }
65
66 BlendShapeIndex& BlendShapeIndex::operator=(const BlendShapeIndex& handle) = default;
67
68 BlendShapeIndex& BlendShapeIndex::operator=(BlendShapeIndex&& rhs) noexcept = default;
69
70 BlendShapeIndex BlendShapeIndex::DownCast(BaseHandle handle)
71 {
72   return BlendShapeIndex(dynamic_cast<Dali::Scene3D::Internal::BlendShapeIndex*>(handle.GetObjectPtr()));
73 }
74
75 BlendShapeIndex::BlendShapeIndex(Dali::Scene3D::Internal::BlendShapeIndex* internal)
76 : MotionIndex(internal)
77 {
78 }
79
80 // Public Method
81
82 void BlendShapeIndex::SetBlendShapeId(Property::Key blendShapeId)
83 {
84   GetImplementation(*this).SetBlendShapeId(blendShapeId);
85 }
86
87 Property::Key BlendShapeIndex::GetBlendShapeId() const
88 {
89   return GetImplementation(*this).GetBlendShapeId();
90 }
91
92 } // namespace Scene3D
93
94 } // namespace Dali