[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / model-motion / motion-value.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-value.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-scene3d/internal/model-motion/motion-value-impl.h>
23
24 namespace Dali
25 {
26 namespace Scene3D
27 {
28 MotionValue MotionValue::New()
29 {
30   Internal::MotionValuePtr internal = Internal::MotionValue::New();
31
32   return MotionValue(internal.Get());
33 }
34
35 MotionValue MotionValue::New(Property::Value propertyValue)
36 {
37   Internal::MotionValuePtr internal = Internal::MotionValue::New();
38
39   internal->SetValue(propertyValue);
40
41   return MotionValue(internal.Get());
42 }
43
44 MotionValue MotionValue::New(KeyFrames keyFrames)
45 {
46   Internal::MotionValuePtr internal = Internal::MotionValue::New();
47
48   internal->SetValue(keyFrames);
49
50   return MotionValue(internal.Get());
51 }
52
53 MotionValue::MotionValue()
54 {
55 }
56
57 MotionValue::MotionValue(const MotionValue& motionValue) = default;
58
59 MotionValue::MotionValue(MotionValue&& rhs) noexcept = default;
60
61 MotionValue::~MotionValue()
62 {
63 }
64
65 MotionValue& MotionValue::operator=(const MotionValue& handle) = default;
66
67 MotionValue& MotionValue::operator=(MotionValue&& rhs) noexcept = default;
68
69 MotionValue MotionValue::DownCast(BaseHandle handle)
70 {
71   return MotionValue(dynamic_cast<Dali::Scene3D::Internal::MotionValue*>(handle.GetObjectPtr()));
72 }
73
74 MotionValue::MotionValue(Dali::Scene3D::Internal::MotionValue* internal)
75 : BaseHandle(internal)
76 {
77 }
78
79 // Public Method
80
81 MotionValue::ValueType MotionValue::GetValueType() const
82 {
83   return GetImplementation(*this).GetValueType();
84 }
85
86 void MotionValue::SetValue(Property::Value propertyValue)
87 {
88   GetImplementation(*this).SetValue(propertyValue);
89 }
90
91 void MotionValue::SetValue(KeyFrames keyFrames)
92 {
93   GetImplementation(*this).SetValue(keyFrames);
94 }
95
96 void MotionValue::Invalidate()
97 {
98   Clear();
99 }
100
101 void MotionValue::Clear()
102 {
103   GetImplementation(*this).Clear();
104 }
105
106 Property::Value MotionValue::GetPropertyValue() const
107 {
108   return GetImplementation(*this).GetPropertyValue();
109 }
110
111 KeyFrames MotionValue::GetKeyFrames() const
112 {
113   return GetImplementation(*this).GetKeyFrames();
114 }
115
116 } // namespace Scene3D
117
118 } // namespace Dali