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