ff91589a75fb908d36e93824147c5f5d8e656743
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / Common / 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         public enum IluminationTypeEnum
81         {
82             DIFFUSE,
83             DIFFUSE_WITH_TEXTURE,
84             DIFFUSE_WITH_NORMAL_MAP
85         }
86
87         public string GeometryUrl
88         {
89             get
90             {
91                 string retVal = "";
92                 PropertyValue geometry = GetProperty(Model3dView.Property.GeometryUrl);
93                 geometry?.Get(out retVal);
94                 geometry?.Dispose();
95                 return retVal;
96             }
97             set
98             {
99                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
100                 SetProperty(Model3dView.Property.GeometryUrl, setVal);
101                 setVal?.Dispose();
102             }
103         }
104         public string MaterialUrl
105         {
106             get
107             {
108                 string retVal = "" ;
109                 PropertyValue material = GetProperty(Model3dView.Property.MaterialUrl);
110                 material?.Get(out retVal);
111                 material?.Dispose();
112                 return retVal;
113             }
114             set
115             {
116                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
117                 SetProperty(Model3dView.Property.MaterialUrl, setVal);
118                 setVal?.Dispose();
119             }
120         }
121         public string ImagesUrl
122         {
123             get
124             {
125                 string retVal = "";
126                 PropertyValue images = GetProperty(Model3dView.Property.ImagesUrl);
127                 images?.Get(out retVal);
128                 images?.Dispose();
129                 return retVal;
130             }
131             set
132             {
133                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
134                 SetProperty(Model3dView.Property.ImagesUrl, setVal);
135                 setVal?.Dispose();
136             }
137         }
138         public int IlluminationType
139         {
140             get
141             {
142                 int retVal = 0;
143                 PropertyValue illumination = GetProperty(Model3dView.Property.IlluminationType);
144                 illumination?.Get(out retVal);
145                 illumination?.Dispose();
146                 return retVal;
147             }
148             set
149             {
150                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
151                 SetProperty(Model3dView.Property.IlluminationType, setVal);
152                 setVal?.Dispose();
153             }
154         }
155         public string Texture0Url
156         {
157             get
158             {
159                 string retVal = "";
160                 PropertyValue texture0 = GetProperty(Model3dView.Property.Texture0Url);
161                 texture0?.Get(out retVal);
162                 texture0?.Dispose();
163                 return retVal;
164             }
165             set
166             {
167                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
168                 SetProperty(Model3dView.Property.Texture0Url, setVal);
169                 setVal?.Dispose();
170             }
171         }
172         public string Texture1Url
173         {
174             get
175             {
176                 string retVal = "";
177                 PropertyValue texture1 = GetProperty(Model3dView.Property.Texture1Url);
178                 texture1?.Get(out retVal);
179                 texture1?.Dispose();
180                 return retVal;
181             }
182             set
183             {
184                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
185                 SetProperty(Model3dView.Property.Texture1Url, setVal);
186                 setVal?.Dispose();
187             }
188         }
189         public string Texture2Url
190         {
191             get
192             {
193                 string retVal = "";
194                 PropertyValue texture2 = GetProperty(Model3dView.Property.Texture2Url);
195                 texture2?.Get(out retVal);
196                 texture2?.Dispose();
197                 return retVal;
198             }
199             set
200             {
201                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
202                 SetProperty(Model3dView.Property.Texture2Url, setVal);
203                 setVal?.Dispose();
204             }
205         }
206         public Vector3 LightPosition
207         {
208             get
209             {
210                 Vector3 retVal = new Vector3(0.0f, 0.0f, 0.0f);
211                 PropertyValue lightPos = GetProperty(Model3dView.Property.LightPosition);
212                 lightPos?.Get(retVal);
213                 lightPos?.Dispose();
214                 return retVal;
215             }
216             set
217             {
218                 PropertyValue setVal = new Tizen.NUI.PropertyValue(value);
219                 SetProperty(Model3dView.Property.LightPosition, setVal);
220                 setVal?.Dispose();
221             }
222         }
223     }
224 }