Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-core.git] / dali / public-api / modeling / model-data.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
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 // CLASS HEADER
18 #include <dali/public-api/modeling/model-data.h>
19
20 // EXTERNAL INCLUDES
21 #include <utility>
22
23 // INTERNAL INCLUDES
24 #include <dali/internal/event/modeling/model-data-impl.h>
25
26 namespace Dali
27 {
28
29 ModelData::ModelData()
30 {
31 }
32
33 ModelData::ModelData(Internal::ModelData* modelData) : BaseHandle(modelData)
34 {
35 }
36
37 ModelData ModelData::New(const std::string& name)
38 {
39   Internal::ModelDataPtr internal = Internal::ModelData::New(name);
40
41   return ModelData(internal.Get());
42 }
43
44 ModelData ModelData::DownCast( BaseHandle handle )
45 {
46   return ModelData( dynamic_cast<Dali::Internal::ModelData*>(handle.GetObjectPtr()) );
47 }
48
49 ModelData::~ModelData()
50 {
51 }
52
53 const std::string& ModelData::GetName() const
54 {
55   return GetImplementation(*this).GetName();
56 }
57
58 void ModelData::SetRootEntity(Entity root)
59 {
60   GetImplementation(*this).SetRootEntity(root);
61 }
62
63 Entity ModelData::GetRootEntity() const
64 {
65   return GetImplementation(*this).GetRootEntity();
66 }
67
68 void ModelData::AddMesh(Dali::MeshData& meshPtr)
69 {
70   GetImplementation(*this).AddMesh(meshPtr);
71 }
72
73 const Dali::MeshData& ModelData::GetMesh(unsigned int index) const
74 {
75   const Internal::ModelData& modelData( GetImplementation(*this) );
76   return modelData.GetMesh(index);
77 }
78
79 Dali::MeshData& ModelData::GetMesh(unsigned int index)
80 {
81   Internal::ModelData& modelData( GetImplementation(*this) );
82   return modelData.GetMesh(index);
83 }
84
85 unsigned int ModelData::NumberOfMeshes() const
86 {
87   return GetImplementation(*this).NumberOfMeshes();
88 }
89
90 void ModelData::AddMaterial(Material material)
91 {
92   GetImplementation(*this).AddMaterial(material);
93 }
94
95 Dali::Material ModelData::GetMaterial(unsigned int index) const
96 {
97   return GetImplementation(*this).GetMaterial(index);
98 }
99
100 unsigned int ModelData::NumberOfMaterials() const
101 {
102   return GetImplementation(*this).NumberOfMaterials();
103 }
104
105 ModelAnimationMapContainer& ModelData::GetAnimationMapContainer()
106 {
107   return GetImplementation(*this).GetAnimationMapContainer();
108 }
109
110 const ModelAnimationMap* ModelData::GetAnimationMap (unsigned int index) const
111 {
112   return GetImplementation(*this).GetAnimationMap(index);
113 }
114
115 const ModelAnimationMap* ModelData::GetAnimationMap (const std::string& name) const
116 {
117   return GetImplementation(*this).GetAnimationMap(name);
118 }
119
120 bool ModelData::FindAnimation (const std::string& name, unsigned int& index) const
121 {
122   return GetImplementation(*this).FindAnimation(name, index);
123 }
124
125 unsigned int ModelData::NumberOfAnimationMaps() const
126 {
127   return GetImplementation(*this).NumberOfAnimationMaps();
128 }
129
130 void ModelData::AddLight(Dali::Light light)
131 {
132   GetImplementation(*this).AddLight(light);
133 }
134
135 Dali::Light ModelData::GetLight(unsigned int index) const
136 {
137   return GetImplementation(*this).GetLight(index);
138 }
139
140 unsigned int ModelData::NumberOfLights() const
141 {
142   return GetImplementation(*this).NumberOfLights();
143 }
144
145 bool ModelData::Read(std::streambuf& buf)
146 {
147   return GetImplementation(*this).Read(buf);
148 }
149
150 bool ModelData::Write(std::streambuf& buf) const
151 {
152   return GetImplementation(*this).Write(buf);
153 }
154
155 } //namespace Dali