2 * Copyright (c) 2014 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/geometry/animatable-mesh.h>
20 #include <dali/internal/event/modeling/animatable-mesh-impl.h>
25 AnimatableMesh::AnimatableMesh()
29 AnimatableMesh AnimatableMesh::New(
30 unsigned int numVertices,
31 const AnimatableMesh::Faces& faceIndices,
32 Dali::Material material )
34 Internal::AnimatableMeshPtr internal = Internal::AnimatableMesh::New( numVertices,
37 return AnimatableMesh(internal.Get());
40 AnimatableMesh AnimatableMesh::New( unsigned int numVertices,
41 const Faces& faceIndices )
44 Internal::AnimatableMeshPtr internal = Internal::AnimatableMesh::New( numVertices, faceIndices );
45 return AnimatableMesh(internal.Get());
48 AnimatableMesh AnimatableMesh::DownCast( BaseHandle handle )
50 return AnimatableMesh( dynamic_cast<Dali::Internal::AnimatableMesh*>(handle.GetObjectPtr()) );
53 AnimatableMesh::~AnimatableMesh()
57 AnimatableMesh::AnimatableMesh(const AnimatableMesh& handle)
58 : Constrainable(handle)
62 AnimatableMesh& AnimatableMesh::operator=(const AnimatableMesh& rhs)
64 BaseHandle::operator=(rhs);
68 unsigned int AnimatableMesh::GetNumberOfVertices() const
70 return GetImplementation(*this).GetNumberOfVertices();
73 AnimatableVertex AnimatableMesh::operator[](const unsigned int index) const
75 DALI_ASSERT_ALWAYS( index < GetNumberOfVertices() && "Index out of bounds" );
77 return AnimatableVertex(index, *this);
80 Property::Index AnimatableMesh::GetPropertyIndex(
82 Property::Index property ) const
84 DALI_ASSERT_ALWAYS( index < GetNumberOfVertices() && "Index out of bounds" );
86 return GetImplementation(*this).GetVertexPropertyIndex( index, property );
89 Property AnimatableMesh::GetVertexProperty( unsigned int vertex, Property::Index property)
91 return Property( *this, GetPropertyIndex( vertex, property ) );
95 AnimatableMesh::AnimatableMesh( Internal::AnimatableMesh* internal )
96 : Constrainable(internal)