2 * Copyright(c) 2017 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.
18 using Tizen.NUI.BaseComponents;
23 internal class Model3dView : View
25 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
27 internal Model3dView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Model3dView_SWIGUpcast(cPtr), cMemoryOwn)
29 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Model3dView obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void Dispose(DisposeTypes type)
44 if (type == DisposeTypes.Explicit)
47 //Release your own managed resources here.
48 //You should release all of your own disposable objects here.
52 //Release your own unmanaged resources here.
53 //You should not access any managed member here except static instance.
54 //because the execution order of Finalizes is non-deterministic.
56 if (swigCPtr.Handle != global::System.IntPtr.Zero)
61 NDalicPINVOKE.delete_Model3dView(swigCPtr);
63 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69 /// <since_tizen> 3 </since_tizen>
70 public new class Property : global::System.IDisposable
72 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
73 /// <since_tizen> 3 </since_tizen>
74 protected bool swigCMemOwn;
76 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
78 swigCMemOwn = cMemoryOwn;
79 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
82 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
84 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
87 //A Flag to check who called Dispose(). (By User or DisposeQueue)
88 private bool isDisposeQueued = false;
89 //A Flat to check if it is already disposed.
90 /// <since_tizen> 3 </since_tizen>
91 protected bool disposed = false;
98 isDisposeQueued = true;
99 DisposeQueue.Instance.Add(this);
103 /// <since_tizen> 3 </since_tizen>
104 public void Dispose()
106 //Throw excpetion if Dispose() is called in separate thread.
107 if (!Window.IsInstalled())
109 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
114 Dispose(DisposeTypes.Implicit);
118 Dispose(DisposeTypes.Explicit);
119 System.GC.SuppressFinalize(this);
123 /// <since_tizen> 3 </since_tizen>
124 protected virtual void Dispose(DisposeTypes type)
131 if (type == DisposeTypes.Explicit)
134 //Release your own managed resources here.
135 //You should release all of your own disposable objects here.
139 //Release your own unmanaged resources here.
140 //You should not access any managed member here except static instance.
141 //because the execution order of Finalizes is non-deterministic.
143 if (swigCPtr.Handle != global::System.IntPtr.Zero)
148 NDalicPINVOKE.delete_Model3dView_Property(swigCPtr);
150 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
156 /// <since_tizen> 3 </since_tizen>
157 public Property() : this(NDalicPINVOKE.new_Model3dView_Property(), true)
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 /// <since_tizen> 3 </since_tizen>
163 public static readonly int GEOMETRY_URL = NDalicPINVOKE.Model3dView_Property_GEOMETRY_URL_get();
164 /// <since_tizen> 3 </since_tizen>
165 public static readonly int MATERIAL_URL = NDalicPINVOKE.Model3dView_Property_MATERIAL_URL_get();
166 /// <since_tizen> 3 </since_tizen>
167 public static readonly int IMAGES_URL = NDalicPINVOKE.Model3dView_Property_IMAGES_URL_get();
168 /// <since_tizen> 3 </since_tizen>
169 public static readonly int ILLUMINATION_TYPE = NDalicPINVOKE.Model3dView_Property_ILLUMINATION_TYPE_get();
170 /// <since_tizen> 3 </since_tizen>
171 public static readonly int TEXTURE0_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE0_URL_get();
172 /// <since_tizen> 3 </since_tizen>
173 public static readonly int TEXTURE1_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE1_URL_get();
174 /// <since_tizen> 3 </since_tizen>
175 public static readonly int TEXTURE2_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE2_URL_get();
176 /// <since_tizen> 3 </since_tizen>
177 public static readonly int LIGHT_POSITION = NDalicPINVOKE.Model3dView_Property_LIGHT_POSITION_get();
181 public Model3dView() : this(NDalicPINVOKE.Model3dView_New__SWIG_0(), true)
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 public Model3dView(string objUrl, string mtlUrl, string imagesUrl) : this(NDalicPINVOKE.Model3dView_New__SWIG_1(objUrl, mtlUrl, imagesUrl), true)
188 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
191 public Model3dView(Model3dView model3dView) : this(NDalicPINVOKE.new_Model3dView__SWIG_1(Model3dView.getCPtr(model3dView)), true)
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public Model3dView Assign(Model3dView model3dView)
198 Model3dView ret = new Model3dView(NDalicPINVOKE.Model3dView_Assign(swigCPtr, Model3dView.getCPtr(model3dView)), false);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 public static Model3dView DownCast(BaseHandle handle)
205 Model3dView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 /// <since_tizen> 3 </since_tizen>
211 public enum IluminationTypeEnum
214 DIFFUSE_WITH_TEXTURE,
215 DIFFUSE_WITH_NORMAL_MAP
218 public string GeometryUrl
223 GetProperty(Model3dView.Property.GEOMETRY_URL).Get(out temp);
228 SetProperty(Model3dView.Property.GEOMETRY_URL, new Tizen.NUI.PropertyValue(value));
231 public string MaterialUrl
236 GetProperty(Model3dView.Property.MATERIAL_URL).Get(out temp);
241 SetProperty(Model3dView.Property.MATERIAL_URL, new Tizen.NUI.PropertyValue(value));
244 public string ImagesUrl
249 GetProperty(Model3dView.Property.IMAGES_URL).Get(out temp);
254 SetProperty(Model3dView.Property.IMAGES_URL, new Tizen.NUI.PropertyValue(value));
257 public int IlluminationType
262 GetProperty(Model3dView.Property.ILLUMINATION_TYPE).Get(out temp);
267 SetProperty(Model3dView.Property.ILLUMINATION_TYPE, new Tizen.NUI.PropertyValue(value));
270 public string Texture0Url
275 GetProperty(Model3dView.Property.TEXTURE0_URL).Get(out temp);
280 SetProperty(Model3dView.Property.TEXTURE0_URL, new Tizen.NUI.PropertyValue(value));
283 public string Texture1Url
288 GetProperty(Model3dView.Property.TEXTURE1_URL).Get(out temp);
293 SetProperty(Model3dView.Property.TEXTURE1_URL, new Tizen.NUI.PropertyValue(value));
296 public string Texture2Url
301 GetProperty(Model3dView.Property.TEXTURE2_URL).Get(out temp);
306 SetProperty(Model3dView.Property.TEXTURE2_URL, new Tizen.NUI.PropertyValue(value));
309 public Vector3 LightPosition
313 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
314 GetProperty(Model3dView.Property.LIGHT_POSITION).Get(temp);
319 SetProperty(Model3dView.Property.LIGHT_POSITION, new Tizen.NUI.PropertyValue(value));