[NUI] Fix build warning & clean code [CA1051]
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Model3dView.cs
1 /*
2  * Copyright(c) 2017 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 Tizen.NUI.BaseComponents;
19
20 namespace Tizen.NUI
21 {
22     internal class Model3dView : View
23     {
24
25         internal Model3dView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Model3DView.Model3dViewUpcast(cPtr), cMemoryOwn)
26         {
27         }
28
29         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Model3dView obj)
30         {
31             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
32         }
33
34         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
35         {
36             Interop.Model3DView.DeleteModel3dView(swigCPtr);
37         }
38
39         internal new class Property
40         {
41             internal static readonly int GeometryUrl = Interop.Model3DView.GeometryUrlGet();
42             internal static readonly int MaterialUrl = Interop.Model3DView.MaterialUrlGet();
43             internal static readonly int ImagesUrl = Interop.Model3DView.ImagesUrlGet();
44             internal static readonly int IlluminationType = Interop.Model3DView.IlluminationTypeGet();
45             internal static readonly int Texture0Url = Interop.Model3DView.Texture0UrlGet();
46             internal static readonly int Texture1Url = Interop.Model3DView.Texture1UrlGet();
47             internal static readonly int Texture2Url = Interop.Model3DView.Texture2UrlGet();
48             internal static readonly int LightPosition = Interop.Model3DView.LightPositionGet();
49         }
50
51         public Model3dView() : this(Interop.Model3DView.Model3dViewNew(), true)
52         {
53             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
54
55         }
56         public Model3dView(string objUrl, string mtlUrl, string imagesUrl) : this(Interop.Model3DView.Model3dViewNew(objUrl, mtlUrl, imagesUrl), true)
57         {
58             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
59
60         }
61         public Model3dView(Model3dView model3dView) : this(Interop.Model3DView.NewModel3dView(Model3dView.getCPtr(model3dView)), true)
62         {
63             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
64         }
65
66         public Model3dView Assign(Model3dView model3dView)
67         {
68             Model3dView ret = new Model3dView(Interop.Model3DView.Model3dViewAssign(SwigCPtr, Model3dView.getCPtr(model3dView)), false);
69             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70             return ret;
71         }
72
73         public static Model3dView DownCast(BaseHandle handle)
74         {
75             Model3dView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
76             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77             return ret;
78         }
79
80         /// <since_tizen> 3 </since_tizen>
81         public enum IluminationTypeEnum
82         {
83             DIFFUSE,
84             DIFFUSE_WITH_TEXTURE,
85             DIFFUSE_WITH_NORMAL_MAP
86         }
87
88         public string GeometryUrl
89         {
90             get
91             {
92                 string temp;
93                 GetProperty(Model3dView.Property.GeometryUrl).Get(out temp);
94                 return temp;
95             }
96             set
97             {
98                 SetProperty(Model3dView.Property.GeometryUrl, new Tizen.NUI.PropertyValue(value));
99             }
100         }
101         public string MaterialUrl
102         {
103             get
104             {
105                 string temp;
106                 GetProperty(Model3dView.Property.MaterialUrl).Get(out temp);
107                 return temp;
108             }
109             set
110             {
111                 SetProperty(Model3dView.Property.MaterialUrl, new Tizen.NUI.PropertyValue(value));
112             }
113         }
114         public string ImagesUrl
115         {
116             get
117             {
118                 string temp;
119                 GetProperty(Model3dView.Property.ImagesUrl).Get(out temp);
120                 return temp;
121             }
122             set
123             {
124                 SetProperty(Model3dView.Property.ImagesUrl, new Tizen.NUI.PropertyValue(value));
125             }
126         }
127         public int IlluminationType
128         {
129             get
130             {
131                 int temp = 0;
132                 GetProperty(Model3dView.Property.IlluminationType).Get(out temp);
133                 return temp;
134             }
135             set
136             {
137                 SetProperty(Model3dView.Property.IlluminationType, new Tizen.NUI.PropertyValue(value));
138             }
139         }
140         public string Texture0Url
141         {
142             get
143             {
144                 string temp;
145                 GetProperty(Model3dView.Property.Texture0Url).Get(out temp);
146                 return temp;
147             }
148             set
149             {
150                 SetProperty(Model3dView.Property.Texture0Url, new Tizen.NUI.PropertyValue(value));
151             }
152         }
153         public string Texture1Url
154         {
155             get
156             {
157                 string temp;
158                 GetProperty(Model3dView.Property.Texture1Url).Get(out temp);
159                 return temp;
160             }
161             set
162             {
163                 SetProperty(Model3dView.Property.Texture1Url, new Tizen.NUI.PropertyValue(value));
164             }
165         }
166         public string Texture2Url
167         {
168             get
169             {
170                 string temp;
171                 GetProperty(Model3dView.Property.Texture2Url).Get(out temp);
172                 return temp;
173             }
174             set
175             {
176                 SetProperty(Model3dView.Property.Texture2Url, new Tizen.NUI.PropertyValue(value));
177             }
178         }
179         public Vector3 LightPosition
180         {
181             get
182             {
183                 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
184                 GetProperty(Model3dView.Property.LightPosition).Get(temp);
185                 return temp;
186             }
187             set
188             {
189                 SetProperty(Model3dView.Property.LightPosition, new Tizen.NUI.PropertyValue(value));
190             }
191         }
192     }
193 }