2 * Copyright (c) 2023 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/model-components/material.h>
22 #include <dali-csharp-binder/common/common.h>
24 extern SWIG_CSharpStringHelperCallback SWIG_csharp_string_callback;
30 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Material_New_SWIG_0()
32 Dali::Scene3D::Material result;
37 result = Dali::Scene3D::Material::New();
39 CALL_CATCH_EXCEPTION(0);
42 return new Dali::Scene3D::Material((const Dali::Scene3D::Material&)result);
45 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Material_SWIG_0()
47 Dali::Scene3D::Material* result = 0;
52 result = (Dali::Scene3D::Material*)new Dali::Scene3D::Material();
54 CALL_CATCH_EXCEPTION(0);
60 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_new_Material_SWIG_1(void* csModel)
62 Dali::Scene3D::Material* model = (Dali::Scene3D::Material*)csModel;
63 Dali::Scene3D::Material* result = 0;
67 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Material const & type is null", 0);
73 result = (Dali::Scene3D::Material*)new Dali::Scene3D::Material((Dali::Scene3D::Material const&)*model);
75 CALL_CATCH_EXCEPTION(0);
81 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_delete_Material(void* csModel)
83 Dali::Scene3D::Material* model = (Dali::Scene3D::Material*)csModel;
89 CALL_CATCH_EXCEPTION();
93 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Material_Assign(void* csDestination, void* csSource)
95 Dali::Scene3D::Material* destination = (Dali::Scene3D::Material*)csDestination;
96 Dali::Scene3D::Material* source = (Dali::Scene3D::Material*)csSource;
97 Dali::Scene3D::Material* result = 0;
101 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Dali::Scene3D::Material const & type is null", 0);
107 result = (Dali::Scene3D::Material*)&(destination)->operator=((Dali::Scene3D::Material const&)*source);
109 CALL_CATCH_EXCEPTION(0);
112 return (void*)result;
115 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Material_DownCast(void* csHandle)
117 Dali::BaseHandle* handle = (Dali::BaseHandle*)csHandle;
118 Dali::Scene3D::Material result;
122 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Material", 0);
128 result = Dali::Scene3D::Material::DownCast(*handle);
130 CALL_CATCH_EXCEPTION(0);
133 return new Dali::Scene3D::Material((const Dali::Scene3D::Material&)result);
136 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_NAME_get()
138 return (int)Dali::Scene3D::Material::Property::NAME;
141 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_BASE_COLOR_URL_get()
143 return (int)Dali::Scene3D::Material::Property::BASE_COLOR_URL;
146 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_BASE_COLOR_FACTOR_get()
148 return (int)Dali::Scene3D::Material::Property::BASE_COLOR_FACTOR;
151 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_METALLIC_ROUGHNESS_URL_get()
153 return (int)Dali::Scene3D::Material::Property::METALLIC_ROUGHNESS_URL;
156 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_METALLIC_FACTOR_get()
158 return (int)Dali::Scene3D::Material::Property::METALLIC_FACTOR;
161 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_ROUGHNESS_FACTOR_get()
163 return (int)Dali::Scene3D::Material::Property::ROUGHNESS_FACTOR;
166 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_NORMAL_URL_get()
168 return (int)Dali::Scene3D::Material::Property::NORMAL_URL;
171 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_NORMAL_SCALE_get()
173 return (int)Dali::Scene3D::Material::Property::NORMAL_SCALE;
176 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_OCCLUSION_URL_get()
178 return (int)Dali::Scene3D::Material::Property::OCCLUSION_URL;
181 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_OCCLUSION_STRENGTH_get()
183 return (int)Dali::Scene3D::Material::Property::OCCLUSION_STRENGTH;
186 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_EMISSIVE_URL_get()
188 return (int)Dali::Scene3D::Material::Property::EMISSIVE_URL;
191 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_EMISSIVE_FACTOR_get()
193 return (int)Dali::Scene3D::Material::Property::EMISSIVE_FACTOR;
196 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_ALPHA_MODE_get()
198 return (int)Dali::Scene3D::Material::Property::ALPHA_MODE;
201 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_ALPHA_CUTOFF_get()
203 return (int)Dali::Scene3D::Material::Property::ALPHA_CUTOFF;
206 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_DOUBLE_SIDED_get()
208 return (int)Dali::Scene3D::Material::Property::DOUBLE_SIDED;
211 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_IOR_get()
213 return (int)Dali::Scene3D::Material::Property::IOR;
216 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_SPECULAR_URL_get()
218 return (int)Dali::Scene3D::Material::Property::SPECULAR_URL;
221 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_SPECULAR_FACTOR_get()
223 return (int)Dali::Scene3D::Material::Property::SPECULAR_FACTOR;
226 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_SPECULAR_COLOR_URL_get()
228 return (int)Dali::Scene3D::Material::Property::SPECULAR_COLOR_URL;
231 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_SPECULAR_COLOR_FACTOR_get()
233 return (int)Dali::Scene3D::Material::Property::SPECULAR_COLOR_FACTOR;
236 SWIGEXPORT int SWIGSTDCALL CSharp_Dali_Material_property_DEPTH_INDEX_get()
238 return (int)Dali::Scene3D::Material::Property::DEPTH_INDEX;
241 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Material_SetProperty(void* csMaterial, int index, void* csPropertyValue)
243 Dali::Scene3D::Material* material = (Dali::Scene3D::Material*)csMaterial;
244 Dali::Property::Value* propertyValue = (Dali::Property::Value*)csPropertyValue;
248 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Material", 0);
254 material->SetProperty((Dali::Property::Index)index, *propertyValue);
256 CALL_CATCH_EXCEPTION();
260 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Material_GetProperty(void* csMaterial, int index)
262 Dali::Scene3D::Material* material = (Dali::Scene3D::Material*)csMaterial;
263 Dali::Property::Value result;
267 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Material", 0);
273 result = material->GetProperty((Dali::Property::Index)index);
275 CALL_CATCH_EXCEPTION(nullptr);
277 return new Dali::Property::Value((const Dali::Property::Value&)result);
280 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Material_SetTexture(void* csMaterial, unsigned int index, void* csTexture)
282 Dali::Scene3D::Material* material = (Dali::Scene3D::Material*)csMaterial;
283 Dali::Texture* texture = (Dali::Texture*)csTexture;
287 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Material", 0);
293 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Texture", 0);
299 material->SetTexture((Dali::Scene3D::Material::TextureType)index, *texture);
301 CALL_CATCH_EXCEPTION();
304 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Material_GetTexture(void* csMaterial, unsigned int index)
306 Dali::Scene3D::Material* material = (Dali::Scene3D::Material*)csMaterial;
307 Dali::Texture result;
311 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Material", 0);
317 result = material->GetTexture((Dali::Scene3D::Material::TextureType)index);
319 CALL_CATCH_EXCEPTION(nullptr);
321 return new Dali::Texture((const Dali::Texture&)result);
324 SWIGEXPORT void SWIGSTDCALL CSharp_Dali_Material_SetSampler(void* csMaterial, unsigned int index, void* csSampler)
326 Dali::Scene3D::Material* material = (Dali::Scene3D::Material*)csMaterial;
327 Dali::Sampler* sampler = (Dali::Sampler*)csSampler;
331 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Material", 0);
337 material->SetSampler((Dali::Scene3D::Material::TextureType)index, *sampler);
339 CALL_CATCH_EXCEPTION();
342 SWIGEXPORT void* SWIGSTDCALL CSharp_Dali_Material_GetSampler(void* csMaterial, unsigned int index)
344 Dali::Scene3D::Material* material = (Dali::Scene3D::Material*)csMaterial;
345 Dali::Sampler result;
349 SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null Dali::Scene3D::Material", 0);
355 result = material->GetSampler((Dali::Scene3D::Material::TextureType)index);
357 CALL_CATCH_EXCEPTION(nullptr);
358 return new Dali::Sampler((const Dali::Sampler&)result);