Merge remote-tracking branch 'origin/API11' into tizen_8.0
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Scene3D / src / public / ModelComponents / Material.cs
1 /*
2  * Copyright(c) 2023 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 using System;
19 using System.Runtime.InteropServices;
20 using System.ComponentModel;
21 using Tizen.NUI;
22 using Tizen.NUI.Binding;
23 using Tizen.NUI.BaseComponents;
24
25 namespace Tizen.NUI.Scene3D
26 {
27     /// <summary>
28     /// Class for setting Material properties of 3D models.
29     /// </summary>
30     /// <remarks>
31     /// This Material class is for setting Material properties of 3D models.
32     /// This Material supports properties and textures for PBR. Also, Material
33     /// can be shared with multiple ModelPrimitives and if the value is modified,
34     /// the rendering results of all ModelPrimitives using this Material will be changed.
35     /// </remarks>
36     /// <example>
37     /// <code>
38     /// Material material = new Material();
39     /// ModelPrimitive modelPrimitive = new ModelPrimitive();
40     /// modelPrimitive.Material = material;
41     /// </code>
42     /// </example>
43     [EditorBrowsable(EditorBrowsableState.Never)]
44     public class Material : BaseHandle
45     {
46         internal Material(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
47         {
48         }
49
50         internal Material(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
51         {
52         }
53
54         /// <summary>
55         /// Create an initialized Material.
56         /// </summary>
57         [EditorBrowsable(EditorBrowsableState.Never)]
58         public Material() : this(Interop.Material.MaterialNew(), true)
59         {
60             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
61         }
62
63         /// <summary>
64         /// Copy constructor.
65         /// </summary>
66         /// <param name="material">Source object to copy.</param>
67         [EditorBrowsable(EditorBrowsableState.Never)]
68         public Material(Material material) : this(Interop.Material.NewMaterial(Material.getCPtr(material)), true, false)
69         {
70             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
71         }
72
73         /// <summary>
74         /// Assignment operator.
75         /// </summary>
76         /// <param name="material">Source object to be assigned.</param>
77         /// <returns>Reference to this.</returns>
78         internal Material Assign(Material material)
79         {
80             Material ret = new Material(Interop.Material.MaterialAssign(SwigCPtr, Material.getCPtr(material)), false);
81             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82             return ret;
83         }
84
85         /// <summary>
86         /// The name of the Material.
87         /// </summary>
88         /// <remarks>
89         /// This Name property is for setting the name of Material. The name can be used to identify the Material.
90         /// </remarks>
91         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
92         [EditorBrowsable(EditorBrowsableState.Never)]
93         public string Name
94         {
95             set
96             {
97                 var temp = new Tizen.NUI.PropertyValue(value);
98                 SetProperty(Interop.Material.PropertyNameIndexGet(), temp);
99                 temp.Dispose();
100             }
101             get
102             {
103                 string temp;
104                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyNameIndexGet());
105                 pValue.Get(out temp);
106                 pValue.Dispose();
107                 return temp;
108             }
109         }
110
111         /// <summary>
112         /// Property for the URL of the base color texture.
113         /// </summary>
114         /// <remarks>
115         /// This texture represents the base color of the material.
116         /// </remarks>
117         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
118         [EditorBrowsable(EditorBrowsableState.Never)]
119         public string BaseColorUrl
120         {
121             set
122             {
123                 var temp = new Tizen.NUI.PropertyValue(value);
124                 SetProperty(Interop.Material.PropertyBaseColorUrlIndexGet(), temp);
125                 temp.Dispose();
126             }
127             get
128             {
129                 string temp;
130                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyBaseColorUrlIndexGet());
131                 pValue.Get(out temp);
132                 pValue.Dispose();
133                 return temp;
134             }
135         }
136
137         /// <summary>
138         /// Property for the base color factor of the material.
139         /// </summary>
140         /// <remarks>
141         /// This factor is multiplied with the base color of the material.
142         /// </remarks>
143         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
144         [EditorBrowsable(EditorBrowsableState.Never)]
145         public Vector4 BaseColorFactor
146         {
147             set
148             {
149                 var temp = new Tizen.NUI.PropertyValue(value);
150                 SetProperty(Interop.Material.PropertyBaseColorFactorIndexGet(), temp);
151                 temp.Dispose();
152             }
153             get
154             {
155                 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
156                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyBaseColorFactorIndexGet());
157                 pValue.Get(temp);
158                 pValue.Dispose();
159                 return temp;
160             }
161         }
162
163         /// <summary>
164         /// Property for the URL of the metallic roughness texture.
165         /// </summary>
166         /// <remarks>
167         /// This texture represents the metallicness and roughness of the material.
168         /// </remarks>
169         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
170         [EditorBrowsable(EditorBrowsableState.Never)]
171         public string MetallicRoughnessUrl
172         {
173             set
174             {
175                 var temp = new Tizen.NUI.PropertyValue(value);
176                 SetProperty(Interop.Material.PropertyMetallicRoughnessUrlIndexGet(), temp);
177                 temp.Dispose();
178             }
179             get
180             {
181                 string temp;
182                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyMetallicRoughnessUrlIndexGet());
183                 pValue.Get(out temp);
184                 pValue.Dispose();
185                 return temp;
186             }
187         }
188
189         /// <summary>
190         /// Property for the metallic factor of the material.
191         /// </summary>
192         /// <remarks>
193         /// This factor is multiplied with the metallicness of the material.
194         /// </remarks>
195         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
196         [EditorBrowsable(EditorBrowsableState.Never)]
197         public float MetallicFactor
198         {
199             set
200             {
201                 var temp = new Tizen.NUI.PropertyValue(value);
202                 SetProperty(Interop.Material.PropertyMetallicFactorIndexGet(), temp);
203                 temp.Dispose();
204             }
205             get
206             {
207                 float temp = 0.0f;
208                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyMetallicFactorIndexGet());
209                 pValue.Get(out temp);
210                 pValue.Dispose();
211                 return temp;
212             }
213         }
214
215         /// <summary>
216         /// Property for the roughness factor of the material.
217         /// </summary>
218         /// <remarks>
219         /// This factor is multiplied with the roughness of the material.
220         /// </remarks>
221         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
222         [EditorBrowsable(EditorBrowsableState.Never)]
223         public float RoughnessFactor
224         {
225             set
226             {
227                 var temp = new Tizen.NUI.PropertyValue(value);
228                 SetProperty(Interop.Material.PropertyRoughnessFactorIndexGet(), temp);
229                 temp.Dispose();
230             }
231             get
232             {
233                 float temp = 0.0f;
234                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyRoughnessFactorIndexGet());
235                 pValue.Get(out temp);
236                 pValue.Dispose();
237                 return temp;
238             }
239         }
240
241         /// <summary>
242         /// Property for the URL of the normal texture.
243         /// </summary>
244         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
245         [EditorBrowsable(EditorBrowsableState.Never)]
246         public string NormalUrl
247         {
248             set
249             {
250                 var temp = new Tizen.NUI.PropertyValue(value);
251                 SetProperty(Interop.Material.PropertyNormalUrlIndexGet(), temp);
252                 temp.Dispose();
253             }
254             get
255             {
256                 string temp;
257                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyNormalUrlIndexGet());
258                 pValue.Get(out temp);
259                 pValue.Dispose();
260                 return temp;
261             }
262         }
263
264         /// <summary>
265         /// Property for the scale of the normal texture.
266         /// </summary>
267         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
268         [EditorBrowsable(EditorBrowsableState.Never)]
269         public float NormalScale
270         {
271             set
272             {
273                 var temp = new Tizen.NUI.PropertyValue(value);
274                 SetProperty(Interop.Material.PropertyNormalScaleIndexGet(), temp);
275                 temp.Dispose();
276             }
277             get
278             {
279                 float temp = 0.0f;
280                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyNormalScaleIndexGet());
281                 pValue.Get(out temp);
282                 pValue.Dispose();
283                 return temp;
284             }
285         }
286
287         /// <summary>
288         /// Property for the URL of the occlusion texture.
289         /// </summary>
290         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
291         [EditorBrowsable(EditorBrowsableState.Never)]
292         public string OcclusionUrl
293         {
294             set
295             {
296                 var temp = new Tizen.NUI.PropertyValue(value);
297                 SetProperty(Interop.Material.PropertyOcclusionUrlIndexGet(), temp);
298                 temp.Dispose();
299             }
300             get
301             {
302                 string temp;
303                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyOcclusionUrlIndexGet());
304                 pValue.Get(out temp);
305                 pValue.Dispose();
306                 return temp;
307             }
308         }
309
310         /// <summary>
311         /// Property for the strength of the occlusion texture.
312         /// </summary>
313         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
314         [EditorBrowsable(EditorBrowsableState.Never)]
315         public float OcclusionStrength
316         {
317             set
318             {
319                 var temp = new Tizen.NUI.PropertyValue(value);
320                 SetProperty(Interop.Material.PropertyOcclusionStrengthIndexGet(), temp);
321                 temp.Dispose();
322             }
323             get
324             {
325                 float temp = 0.0f;
326                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyOcclusionStrengthIndexGet());
327                 pValue.Get(out temp);
328                 pValue.Dispose();
329                 return temp;
330             }
331         }
332
333         /// <summary>
334         /// Property for the URL of the emissive texture.
335         /// </summary>
336         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
337         [EditorBrowsable(EditorBrowsableState.Never)]
338         public string EmissiveUrl
339         {
340             set
341             {
342                 var temp = new Tizen.NUI.PropertyValue(value);
343                 SetProperty(Interop.Material.PropertyEmissiveUrlIndexGet(), temp);
344                 temp.Dispose();
345             }
346             get
347             {
348                 string temp;
349                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyEmissiveUrlIndexGet());
350                 pValue.Get(out temp);
351                 pValue.Dispose();
352                 return temp;
353             }
354         }
355
356         /// <summary>
357         /// Property for the emissive factor of the material.
358         /// </summary>
359         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
360         [EditorBrowsable(EditorBrowsableState.Never)]
361         public Vector3 EmissiveFactor
362         {
363             set
364             {
365                 var temp = new Tizen.NUI.PropertyValue(value);
366                 SetProperty(Interop.Material.PropertyEmissiveFactorIndexGet(), temp);
367                 temp.Dispose();
368             }
369             get
370             {
371                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
372                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyEmissiveFactorIndexGet());
373                 pValue.Get(temp);
374                 pValue.Dispose();
375                 return temp;
376             }
377         }
378
379         /// <summary>
380         /// Property for the alpha blending mode of the material.
381         /// </summary>
382         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
383         [EditorBrowsable(EditorBrowsableState.Never)]
384         public MaterialAlphaModeType AlphaMode
385         {
386             set
387             {
388                 var temp = new Tizen.NUI.PropertyValue((int)value);
389                 SetProperty(Interop.Material.PropertyAlphaModeIndexGet(), temp);
390                 temp.Dispose();
391             }
392             get
393             {
394                 int temp = 0;
395                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyAlphaModeIndexGet());
396                 pValue.Get(out temp);
397                 pValue.Dispose();
398                 return (MaterialAlphaModeType)temp;
399             }
400         }
401
402         /// <summary>
403         /// Property for the alpha cutoff value of the material.
404         /// </summary>
405         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
406         [EditorBrowsable(EditorBrowsableState.Never)]
407         public float AlphaCutoff
408         {
409             set
410             {
411                 var temp = new Tizen.NUI.PropertyValue(value);
412                 SetProperty(Interop.Material.PropertyAlphaCutOffIndexGet(), temp);
413                 temp.Dispose();
414             }
415             get
416             {
417                 float temp = 0.0f;
418                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyAlphaCutOffIndexGet());
419                 pValue.Get(out temp);
420                 pValue.Dispose();
421                 return temp;
422             }
423         }
424
425         /// <summary>
426         /// Property for the double sided material flag.
427         /// </summary>
428         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
429         [EditorBrowsable(EditorBrowsableState.Never)]
430         public bool DoubleSided
431         {
432             set
433             {
434                 var temp = new Tizen.NUI.PropertyValue(value);
435                 SetProperty(Interop.Material.PropertyDoubleSidedIndexGet(), temp);
436                 temp.Dispose();
437             }
438             get
439             {
440                 bool temp = false;
441                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyDoubleSidedIndexGet());
442                 pValue.Get(out temp);
443                 pValue.Dispose();
444                 return temp;
445             }
446         }
447
448         /// <summary>
449         /// Property for the index of refraction of the material.
450         /// </summary>
451         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
452         [EditorBrowsable(EditorBrowsableState.Never)]
453         public float Ior
454         {
455             set
456             {
457                 var temp = new Tizen.NUI.PropertyValue(value);
458                 SetProperty(Interop.Material.PropertyIorIndexGet(), temp);
459                 temp.Dispose();
460             }
461             get
462             {
463                 float temp = 0.0f;
464                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyIorIndexGet());
465                 pValue.Get(out temp);
466                 pValue.Dispose();
467                 return temp;
468             }
469         }
470
471         /// <summary>
472         /// Property for the URL of the specular texture.
473         /// </summary>
474         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
475         [EditorBrowsable(EditorBrowsableState.Never)]
476         public string SpecularUrl
477         {
478             set
479             {
480                 var temp = new Tizen.NUI.PropertyValue(value);
481                 SetProperty(Interop.Material.PropertySpecularUrlIndexGet(), temp);
482                 temp.Dispose();
483             }
484             get
485             {
486                 string temp;
487                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertySpecularUrlIndexGet());
488                 pValue.Get(out temp);
489                 pValue.Dispose();
490                 return temp;
491             }
492         }
493
494
495
496
497         /// <summary>
498         /// Property for the specular factor of the material.
499         /// </summary>
500         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
501         [EditorBrowsable(EditorBrowsableState.Never)]
502         public float SpecularFactor
503         {
504             set
505             {
506                 var temp = new Tizen.NUI.PropertyValue(value);
507                 SetProperty(Interop.Material.PropertySpecularFactorIndexGet(), temp);
508                 temp.Dispose();
509             }
510             get
511             {
512                 float temp = 0.0f;
513                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertySpecularFactorIndexGet());
514                 pValue.Get(out temp);
515                 pValue.Dispose();
516                 return temp;
517             }
518         }
519
520         /// <summary>
521         /// Property for the URL of the specular color texture.
522         /// </summary>
523         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
524         [EditorBrowsable(EditorBrowsableState.Never)]
525         public string SpecularColorUrl
526         {
527             set
528             {
529                 var temp = new Tizen.NUI.PropertyValue(value);
530                 SetProperty(Interop.Material.PropertySpecularColorUrlIndexGet(), temp);
531                 temp.Dispose();
532             }
533             get
534             {
535                 string temp;
536                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertySpecularColorUrlIndexGet());
537                 pValue.Get(out temp);
538                 pValue.Dispose();
539                 return temp;
540             }
541         }
542
543         /// <summary>
544         /// Property for the specular color factor of the material.
545         /// </summary>
546         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
547         [EditorBrowsable(EditorBrowsableState.Never)]
548         public Vector3 SpecularColorFactor
549         {
550             set
551             {
552                 var temp = new Tizen.NUI.PropertyValue(value);
553                 SetProperty(Interop.Material.PropertySpecularColorFactorIndexGet(), temp);
554                 temp.Dispose();
555             }
556             get
557             {
558                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
559                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertySpecularColorFactorIndexGet());
560                 pValue.Get(temp);
561                 pValue.Dispose();
562                 return temp;
563             }
564         }
565
566         /// <summary>
567         /// Property to define rendering order.
568         /// </summary>
569         /// <remarks>
570         /// Depth index is used to defind rendering order. Basically,
571         /// a Renderer that has smaller depth index is rendered earlier.
572         /// In the ordinary DALI UI components has 0 as depth index by default.
573         /// (For the case of Toolkit::Control, its renderer has depth index
574         /// value between [-20, 20] as fallowing the renderer's purpose)
575         ///
576         /// In the Scene3D cases, the rendering order of each Renderer may need
577         /// to be manually defined to match scene developer's intent.
578         /// Scene3D::DepthIndex::Ranges could be used to adjust rendering order
579         /// between 3D Scene content.
580         /// Or it also could be used to manage UI component in 3D Scene independently.
581         ///
582         /// Changing the depth index only affects the rendering order, and does not
583         /// mean that objects drawn later will be drawn on top. To compute final
584         /// rendering order, whether the object is opaque or non-opaque takes precedence
585         /// over the depth index. Changing the rendering order among translucent objects
586         /// has a significant impact on the rendering results.
587         ///
588         /// The predefined depth index range is definded in <see cref="MaterialDepthIndexRange"/>.
589         /// </remarks>
590         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
591         [EditorBrowsable(EditorBrowsableState.Never)]
592         public int DepthIndex
593         {
594             set
595             {
596                 var temp = new Tizen.NUI.PropertyValue(value);
597                 SetProperty(Interop.Material.PropertyDepthIndexIndexGet(), temp);
598                 temp.Dispose();
599             }
600             get
601             {
602                 int temp = 0;
603                 Tizen.NUI.PropertyValue pValue = GetProperty(Interop.Material.PropertyDepthIndexIndexGet());
604                 pValue.Get(out temp);
605                 pValue.Dispose();
606                 return temp;
607             }
608         }
609
610         /// <summary>
611         /// Sets the texture of the ModelNode object for the specified texture type.
612         /// </summary>
613         /// <param name="textureType">The TextureType of the texture to set.</param>
614         /// <param name="texture">The Texture object to set.</param>
615         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
616         [EditorBrowsable(EditorBrowsableState.Never)]
617         public void SetTexture(MaterialTextureType textureType, Texture texture)
618         {
619             Interop.Material.SetTexture(SwigCPtr, (int)textureType, Texture.getCPtr(texture));
620             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621         }
622
623         /// <summary>
624         /// Gets the texture of the ModelNode object for the specified texture type.
625         /// </summary>
626         /// <param name="textureType">The TextureType of the texture to get.</param>
627         /// <returns>The Texture object of the ModelNode object for the specified texture type.</returns>
628         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
629         [EditorBrowsable(EditorBrowsableState.Never)]
630         public Texture GetTexture(MaterialTextureType textureType)
631         {
632             IntPtr cPtr = Interop.Material.GetTexture(SwigCPtr, (int)textureType);
633             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
634             Texture ret = (cPtr == IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Texture;
635             return ret;
636         }
637
638         /// <summary>
639         /// Sets the sampler of the ModelNode object for the specified texture type.
640         /// </summary>
641         /// <param name="textureType">The TextureType of the sampler to set.</param>
642         /// <param name="sampler">The Sampler object to set.</param>
643         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
644         [EditorBrowsable(EditorBrowsableState.Never)]
645         public void SetSampler(MaterialTextureType textureType, Sampler sampler)
646         {
647             Interop.Material.SetSampler(SwigCPtr, (int)textureType, Sampler.getCPtr(sampler));
648             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
649         }
650
651         /// <summary>
652         /// Gets the sampler of the ModelNode object for the specified texture type.
653         /// </summary>
654         /// <param name="textureType">The TextureType of the sampler to get.</param>
655         /// <returns>The Sampler object of the ModelNode object for the specified texture type.</returns>
656         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
657         [EditorBrowsable(EditorBrowsableState.Never)]
658         public Sampler GetSampler(MaterialTextureType textureType)
659         {
660             IntPtr cPtr = Interop.Material.GetSampler(SwigCPtr, (int)textureType);
661             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
662             Sampler ret = (cPtr == IntPtr.Zero) ? null : Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Sampler;
663             return ret;
664         }
665
666         /// <summary>
667         /// Sets the value of an existing property.
668         /// </summary>
669         /// <param name="index">The index of the property.</param>
670         /// <param name="propertyValue">The new value of the property.</param>
671         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
672         [EditorBrowsable(EditorBrowsableState.Never)]
673         private void SetProperty(int index, PropertyValue propertyValue)
674         {
675             global::System.Runtime.InteropServices.HandleRef handle = SwigCPtr;
676             if (handle.Handle == global::System.IntPtr.Zero)
677             {
678                 throw new global::System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
679             }
680
681             Interop.Material.SetProperty(handle, index, PropertyValue.getCPtr(propertyValue));
682             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
683         }
684
685         /// <summary>
686         /// Retrieves a property value.
687         /// </summary>
688         /// <param name="index">The index of the property.</param>
689         /// <returns>The property value.</returns>
690         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
691         [EditorBrowsable(EditorBrowsableState.Never)]
692         private PropertyValue GetProperty(int index)
693         {
694             global::System.Runtime.InteropServices.HandleRef handle = SwigCPtr;
695             if (handle.Handle == global::System.IntPtr.Zero)
696             {
697                 throw new global::System.InvalidOperationException("Error! NUI's native dali object is already disposed. OR the native dali object handle of NUI becomes null!");
698             }
699
700             PropertyValue ret = new PropertyValue(Interop.Material.GetProperty(handle, index), true);
701             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702             return ret;
703         }
704
705         /// <summary>
706         /// Release swigCPtr.
707         /// </summary>
708         // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API)
709         [EditorBrowsable(EditorBrowsableState.Never)]
710         protected override void ReleaseSwigCPtr(global::System.Runtime.InteropServices.HandleRef swigCPtr)
711         {
712             Interop.Material.DeleteMaterial(swigCPtr);
713         }
714     }
715 }