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/modeling/model-data.h>
25 #include <dali/internal/event/modeling/model-data-impl.h>
30 ModelData::ModelData()
34 ModelData::ModelData(Internal::ModelData* modelData) : BaseHandle(modelData)
38 ModelData ModelData::New(const std::string& name)
40 Internal::ModelDataPtr internal = Internal::ModelData::New(name);
42 return ModelData(internal.Get());
45 ModelData ModelData::DownCast( BaseHandle handle )
47 return ModelData( dynamic_cast<Dali::Internal::ModelData*>(handle.GetObjectPtr()) );
50 ModelData::~ModelData()
54 ModelData::ModelData(const ModelData& handle)
59 ModelData& ModelData::operator=(const ModelData& rhs)
61 BaseHandle::operator=(rhs);
65 const std::string& ModelData::GetName() const
67 return GetImplementation(*this).GetName();
70 void ModelData::SetRootEntity(Entity root)
72 GetImplementation(*this).SetRootEntity(root);
75 Entity ModelData::GetRootEntity() const
77 return GetImplementation(*this).GetRootEntity();
80 void ModelData::AddMesh(Dali::MeshData& meshPtr)
82 GetImplementation(*this).AddMesh(meshPtr);
85 const Dali::MeshData& ModelData::GetMesh(unsigned int index) const
87 const Internal::ModelData& modelData( GetImplementation(*this) );
88 return modelData.GetMesh(index);
91 Dali::MeshData& ModelData::GetMesh(unsigned int index)
93 Internal::ModelData& modelData( GetImplementation(*this) );
94 return modelData.GetMesh(index);
97 unsigned int ModelData::NumberOfMeshes() const
99 return GetImplementation(*this).NumberOfMeshes();
102 void ModelData::AddMaterial(Material material)
104 GetImplementation(*this).AddMaterial(material);
107 Dali::Material ModelData::GetMaterial(unsigned int index) const
109 return GetImplementation(*this).GetMaterial(index);
112 unsigned int ModelData::NumberOfMaterials() const
114 return GetImplementation(*this).NumberOfMaterials();
117 ModelAnimationMapContainer& ModelData::GetAnimationMapContainer()
119 return GetImplementation(*this).GetAnimationMapContainer();
122 bool ModelData::FindAnimation (const std::string& name, unsigned int& index) const
124 return GetImplementation(*this).FindAnimation(name, index);
127 unsigned int ModelData::NumberOfAnimationMaps() const
129 return GetImplementation(*this).NumberOfAnimationMaps();
132 void ModelData::AddLight(Dali::Light light)
134 GetImplementation(*this).AddLight(light);
137 Dali::Light ModelData::GetLight(unsigned int index) const
139 return GetImplementation(*this).GetLight(index);
142 unsigned int ModelData::NumberOfLights() const
144 return GetImplementation(*this).NumberOfLights();
147 bool ModelData::Read(std::streambuf& buf)
149 return GetImplementation(*this).Read(buf);
152 bool ModelData::Write(std::streambuf& buf) const
154 return GetImplementation(*this).Write(buf);