2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
18 #include <dali/public-api/modeling/model-data.h>
24 #include <dali/internal/event/modeling/model-data-impl.h>
29 ModelData::ModelData()
33 ModelData::ModelData(Internal::ModelData* modelData) : BaseHandle(modelData)
37 ModelData ModelData::New(const std::string& name)
39 Internal::ModelDataPtr internal = Internal::ModelData::New(name);
41 return ModelData(internal.Get());
44 ModelData ModelData::DownCast( BaseHandle handle )
46 return ModelData( dynamic_cast<Dali::Internal::ModelData*>(handle.GetObjectPtr()) );
49 ModelData::~ModelData()
53 const std::string& ModelData::GetName() const
55 return GetImplementation(*this).GetName();
58 void ModelData::SetRootEntity(Entity root)
60 GetImplementation(*this).SetRootEntity(root);
63 Entity ModelData::GetRootEntity() const
65 return GetImplementation(*this).GetRootEntity();
68 void ModelData::AddMesh(Dali::MeshData& meshPtr)
70 GetImplementation(*this).AddMesh(meshPtr);
73 const Dali::MeshData& ModelData::GetMesh(unsigned int index) const
75 const Internal::ModelData& modelData( GetImplementation(*this) );
76 return modelData.GetMesh(index);
79 Dali::MeshData& ModelData::GetMesh(unsigned int index)
81 Internal::ModelData& modelData( GetImplementation(*this) );
82 return modelData.GetMesh(index);
85 unsigned int ModelData::NumberOfMeshes() const
87 return GetImplementation(*this).NumberOfMeshes();
90 void ModelData::AddMaterial(Material material)
92 GetImplementation(*this).AddMaterial(material);
95 Dali::Material ModelData::GetMaterial(unsigned int index) const
97 return GetImplementation(*this).GetMaterial(index);
100 unsigned int ModelData::NumberOfMaterials() const
102 return GetImplementation(*this).NumberOfMaterials();
105 ModelAnimationMapContainer& ModelData::GetAnimationMapContainer()
107 return GetImplementation(*this).GetAnimationMapContainer();
110 const ModelAnimationMap* ModelData::GetAnimationMap (unsigned int index) const
112 return GetImplementation(*this).GetAnimationMap(index);
115 const ModelAnimationMap* ModelData::GetAnimationMap (const std::string& name) const
117 return GetImplementation(*this).GetAnimationMap(name);
120 bool ModelData::FindAnimation (const std::string& name, unsigned int& index) const
122 return GetImplementation(*this).FindAnimation(name, index);
125 unsigned int ModelData::NumberOfAnimationMaps() const
127 return GetImplementation(*this).NumberOfAnimationMaps();
130 void ModelData::AddLight(Dali::Light light)
132 GetImplementation(*this).AddLight(light);
135 Dali::Light ModelData::GetLight(unsigned int index) const
137 return GetImplementation(*this).GetLight(index);
140 unsigned int ModelData::NumberOfLights() const
142 return GetImplementation(*this).NumberOfLights();
145 bool ModelData::Read(std::streambuf& buf)
147 return GetImplementation(*this).Read(buf);
150 bool ModelData::Write(std::streambuf& buf) const
152 return GetImplementation(*this).Write(buf);