2 * Copyright (c) 2022 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-scene3d/public-api/controls/model/model.h>
28 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_New_SWIG_0(char* csModelPath, char* csResourcePath)
30 Dali::Scene3D::Model result;
34 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
37 std::string modelPath(csModelPath);
41 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
44 std::string resourcePath(csResourcePath);
49 result = Dali::Scene3D::Model::New(modelPath, resourcePath);
51 CALL_CATCH_EXCEPTION(0);
54 return new Dali::Scene3D::Model((const Dali::Scene3D::Model&)result);
57 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Model_SWIG_0()
59 Dali::Scene3D::Model* result = 0;
64 result = (Dali::Scene3D::Model*)new Dali::Scene3D::Model();
66 CALL_CATCH_EXCEPTION(0);
72 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Model_SWIG_1(void* csModel)
74 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
75 Dali::Scene3D::Model* result = 0;
79 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Model const & type is null", 0);
85 result = (Dali::Scene3D::Model*)new Dali::Scene3D::Model((Dali::Scene3D::Model const&)*model);
87 CALL_CATCH_EXCEPTION(0);
93 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_Model(void* csModel)
95 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
101 CALL_CATCH_EXCEPTION();
105 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_Assign(void* csDestination, void* csSource)
107 Dali::Scene3D::Model* destination = (Dali::Scene3D::Model*)csDestination;
108 Dali::Scene3D::Model* source = (Dali::Scene3D::Model*)csSource;
109 Dali::Scene3D::Model* result = 0;
113 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Model const & type is null", 0);
119 result = (Dali::Scene3D::Model*)&(destination)->operator=((Dali::Scene3D::Model const&)*source);
121 CALL_CATCH_EXCEPTION(0);
124 return (void*)result;
127 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_DownCast(void* csHandle)
129 Dali::BaseHandle* handle = (Dali::BaseHandle*)csHandle;
130 Dali::Scene3D::Model result;
134 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
140 result = Dali::Scene3D::Model::DownCast(*handle);
142 CALL_CATCH_EXCEPTION(0);
145 return new Dali::Scene3D::Model((const Dali::Scene3D::Model&)result);
148 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_GetModelRoot(void* csModel)
150 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
155 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
161 result = model->GetModelRoot();
163 CALL_CATCH_EXCEPTION(0);
166 return new Dali::Actor((const Dali::Actor&)result);
169 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Model_SetChildrenSensitive(void* csModel, bool enable)
171 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
175 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
181 model->SetChildrenSensitive(enable);
183 CALL_CATCH_EXCEPTION();
187 SWIGEXPORT bool SWIGSTDCALL CSharp_Dali_Model_GetChildrenSensitive(void* csModel)
189 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
194 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
200 result = model->GetChildrenSensitive();
202 CALL_CATCH_EXCEPTION(0);
207 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Model_SetImageBasedLightSource(void* csModel, char* csDiffuseUrl, char* csSpecularUrl, float scaleFactor)
209 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
213 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
218 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
221 std::string diffuseUrl(csDiffuseUrl);
224 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
227 std::string specularUrl(csSpecularUrl);
231 model->SetImageBasedLightSource(diffuseUrl, specularUrl, scaleFactor);
233 CALL_CATCH_EXCEPTION();
237 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Model_SetImageBasedLightScaleFactor(void* csModel, float scaleFactor)
239 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
243 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
249 model->SetImageBasedLightScaleFactor(scaleFactor);
251 CALL_CATCH_EXCEPTION();
255 SWIGEXPORT float SWIGSTDCALL CSharp_Dali_Model_GetImageBasedLightScaleFactor(void* csModel)
257 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
258 float scaleFactor = 1.0f;
262 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
268 scaleFactor = model->GetImageBasedLightScaleFactor();
270 CALL_CATCH_EXCEPTION(0.0f);
275 SWIGEXPORT unsigned int SWIGSTDCALL CSharp_Dali_Model_GetAnimationCount(void* csModel)
277 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
282 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
288 result = model->GetAnimationCount();
290 CALL_CATCH_EXCEPTION(0);
296 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_GetAnimation_1(void* csModel, unsigned int index)
298 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
299 Dali::Animation result;
303 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
309 result = model->GetAnimation(index);
311 CALL_CATCH_EXCEPTION(0);
314 return new Dali::Animation((const Dali::Animation&)result);
317 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Model_GetAnimation_2(void* csModel, char* csName)
319 Dali::Scene3D::Model* model = (Dali::Scene3D::Model*)csModel;
320 Dali::Animation result;
324 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Model", 0);
329 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "null string", 0);
332 std::string name(csName);
336 result = model->GetAnimation(name);
338 CALL_CATCH_EXCEPTION(0);
341 return new Dali::Animation((const Dali::Animation&)result);