2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/public-api/animation/path.h>
20 #include <dali/internal/event/animation/path-impl.h>
29 Internal::Path* internal = Internal::Path::New();
30 return Path(internal);
33 Path Path::DownCast( BaseHandle handle )
35 return Path( dynamic_cast<Dali::Internal::Path*>(handle.GetObjectPtr()) );
46 Path::Path(const Path& handle) = default;
48 Path::Path(Internal::Path* internal)
53 Path& Path::operator=(const Path& rhs) = default;
55 Path::Path( Path&& rhs ) = default;
57 Path& Path::operator=( Path&& rhs ) = default;
59 void Path::AddPoint(const Vector3& point )
61 GetImplementation(*this).AddPoint( point );
64 void Path::AddControlPoint(const Vector3& point )
66 GetImplementation(*this).AddControlPoint( point );
69 void Path::GenerateControlPoints( float curvature )
71 GetImplementation(*this).GenerateControlPoints( curvature );
75 void Path::Sample( float progress, Vector3& position, Vector3& tangent ) const
77 GetImplementation(*this).Sample( progress, position, tangent );
80 Vector3& Path::GetPoint( size_t index )
82 return GetImplementation(*this).GetPoint( static_cast<uint32_t>( index ) );
85 Vector3& Path::GetControlPoint( size_t index )
87 return GetImplementation(*this).GetControlPoint( static_cast<uint32_t>( index ) );
90 size_t Path::GetPointCount() const
92 return GetImplementation(*this).GetPointCount();