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