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