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