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