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 public new class Property : global::System.IDisposable
71 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
72 protected bool swigCMemOwn;
74 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
76 swigCMemOwn = cMemoryOwn;
77 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
80 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
82 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
85 //A Flag to check who called Dispose(). (By User or DisposeQueue)
86 private bool isDisposeQueued = false;
87 //A Flat to check if it is already disposed.
88 protected bool disposed = false;
95 isDisposeQueued = true;
96 DisposeQueue.Instance.Add(this);
100 public void Dispose()
102 //Throw excpetion if Dispose() is called in separate thread.
103 if (!Window.IsInstalled())
105 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
110 Dispose(DisposeTypes.Implicit);
114 Dispose(DisposeTypes.Explicit);
115 System.GC.SuppressFinalize(this);
119 protected virtual void Dispose(DisposeTypes type)
126 if (type == DisposeTypes.Explicit)
129 //Release your own managed resources here.
130 //You should release all of your own disposable objects here.
134 //Release your own unmanaged resources here.
135 //You should not access any managed member here except static instance.
136 //because the execution order of Finalizes is non-deterministic.
138 if (swigCPtr.Handle != global::System.IntPtr.Zero)
143 NDalicPINVOKE.delete_Model3dView_Property(swigCPtr);
145 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
151 public Property() : this(NDalicPINVOKE.new_Model3dView_Property(), true)
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156 public static readonly int GEOMETRY_URL = NDalicPINVOKE.Model3dView_Property_GEOMETRY_URL_get();
157 public static readonly int MATERIAL_URL = NDalicPINVOKE.Model3dView_Property_MATERIAL_URL_get();
158 public static readonly int IMAGES_URL = NDalicPINVOKE.Model3dView_Property_IMAGES_URL_get();
159 public static readonly int ILLUMINATION_TYPE = NDalicPINVOKE.Model3dView_Property_ILLUMINATION_TYPE_get();
160 public static readonly int TEXTURE0_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE0_URL_get();
161 public static readonly int TEXTURE1_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE1_URL_get();
162 public static readonly int TEXTURE2_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE2_URL_get();
163 public static readonly int LIGHT_POSITION = NDalicPINVOKE.Model3dView_Property_LIGHT_POSITION_get();
167 public Model3dView() : this(NDalicPINVOKE.Model3dView_New__SWIG_0(), true)
169 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 public Model3dView(string objUrl, string mtlUrl, string imagesUrl) : this(NDalicPINVOKE.Model3dView_New__SWIG_1(objUrl, mtlUrl, imagesUrl), true)
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 public Model3dView(Model3dView model3dView) : this(NDalicPINVOKE.new_Model3dView__SWIG_1(Model3dView.getCPtr(model3dView)), true)
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
182 public Model3dView Assign(Model3dView model3dView)
184 Model3dView ret = new Model3dView(NDalicPINVOKE.Model3dView_Assign(swigCPtr, Model3dView.getCPtr(model3dView)), false);
185 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public new static Model3dView DownCast(BaseHandle handle)
191 Model3dView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public enum IluminationTypeEnum
199 DIFFUSE_WITH_TEXTURE,
200 DIFFUSE_WITH_NORMAL_MAP
203 public string GeometryUrl
208 GetProperty(Model3dView.Property.GEOMETRY_URL).Get(out temp);
213 SetProperty(Model3dView.Property.GEOMETRY_URL, new Tizen.NUI.PropertyValue(value));
216 public string MaterialUrl
221 GetProperty(Model3dView.Property.MATERIAL_URL).Get(out temp);
226 SetProperty(Model3dView.Property.MATERIAL_URL, new Tizen.NUI.PropertyValue(value));
229 public string ImagesUrl
234 GetProperty(Model3dView.Property.IMAGES_URL).Get(out temp);
239 SetProperty(Model3dView.Property.IMAGES_URL, new Tizen.NUI.PropertyValue(value));
242 public int IlluminationType
247 GetProperty(Model3dView.Property.ILLUMINATION_TYPE).Get(out temp);
252 SetProperty(Model3dView.Property.ILLUMINATION_TYPE, new Tizen.NUI.PropertyValue(value));
255 public string Texture0Url
260 GetProperty(Model3dView.Property.TEXTURE0_URL).Get(out temp);
265 SetProperty(Model3dView.Property.TEXTURE0_URL, new Tizen.NUI.PropertyValue(value));
268 public string Texture1Url
273 GetProperty(Model3dView.Property.TEXTURE1_URL).Get(out temp);
278 SetProperty(Model3dView.Property.TEXTURE1_URL, new Tizen.NUI.PropertyValue(value));
281 public string Texture2Url
286 GetProperty(Model3dView.Property.TEXTURE2_URL).Get(out temp);
291 SetProperty(Model3dView.Property.TEXTURE2_URL, new Tizen.NUI.PropertyValue(value));
294 public Vector3 LightPosition
298 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
299 GetProperty(Model3dView.Property.LIGHT_POSITION).Get(temp);
304 SetProperty(Model3dView.Property.LIGHT_POSITION, new Tizen.NUI.PropertyValue(value));