Ensure BaseHandle class move noexcept (core public-api)
[platform/core/uifw/dali-core.git] / dali / public-api / animation / path.cpp
1 /*
2  * Copyright (c) 2020 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/internal/event/animation/path-impl.h>
20 #include <dali/public-api/animation/path.h>
21
22 // INTERNAL INCLUDES
23
24 namespace Dali
25 {
26 Path Path::New()
27 {
28   Internal::Path* internal = Internal::Path::New();
29   return Path(internal);
30 }
31
32 Path Path::DownCast(BaseHandle handle)
33 {
34   return Path(dynamic_cast<Dali::Internal::Path*>(handle.GetObjectPtr()));
35 }
36
37 Path::Path() = default;
38
39 Path::~Path() = default;
40
41 Path::Path(const Path& handle) = default;
42
43 Path::Path(Internal::Path* internal)
44 : Handle(internal)
45 {
46 }
47
48 Path& Path::operator=(const Path& rhs) = default;
49
50 Path::Path(Path&& rhs) noexcept = default;
51
52 Path& Path::operator=(Path&& rhs) noexcept = default;
53
54 void Path::AddPoint(const Vector3& point)
55 {
56   GetImplementation(*this).AddPoint(point);
57 }
58
59 void Path::AddControlPoint(const Vector3& point)
60 {
61   GetImplementation(*this).AddControlPoint(point);
62 }
63
64 void Path::GenerateControlPoints(float curvature)
65 {
66   GetImplementation(*this).GenerateControlPoints(curvature);
67 }
68
69 void Path::Sample(float progress, Vector3& position, Vector3& tangent) const
70 {
71   GetImplementation(*this).Sample(progress, position, tangent);
72 }
73
74 Vector3& Path::GetPoint(size_t index)
75 {
76   return GetImplementation(*this).GetPoint(static_cast<uint32_t>(index));
77 }
78
79 Vector3& Path::GetControlPoint(size_t index)
80 {
81   return GetImplementation(*this).GetControlPoint(static_cast<uint32_t>(index));
82 }
83
84 size_t Path::GetPointCount() const
85 {
86   return GetImplementation(*this).GetPointCount();
87 }
88
89 } // namespace Dali