1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 using Tizen.NUI.BaseComponents;
22 internal class Model3dView : View
24 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
26 internal Model3dView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Model3dView_SWIGUpcast(cPtr), cMemoryOwn)
28 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
31 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Model3dView obj)
33 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
36 protected override void Dispose(DisposeTypes type)
43 if (type == DisposeTypes.Explicit)
46 //Release your own managed resources here.
47 //You should release all of your own disposable objects here.
51 //Release your own unmanaged resources here.
52 //You should not access any managed member here except static instance.
53 //because the execution order of Finalizes is non-deterministic.
55 if (swigCPtr.Handle != global::System.IntPtr.Zero)
60 NDalicPINVOKE.delete_Model3dView(swigCPtr);
62 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
68 public new class Property : global::System.IDisposable
70 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
71 protected bool swigCMemOwn;
73 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
75 swigCMemOwn = cMemoryOwn;
76 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
79 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
81 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
84 //A Flag to check who called Dispose(). (By User or DisposeQueue)
85 private bool isDisposeQueued = false;
86 //A Flat to check if it is already disposed.
87 protected bool disposed = false;
94 isDisposeQueued = true;
95 DisposeQueue.Instance.Add(this);
101 //Throw excpetion if Dispose() is called in separate thread.
102 if (!Window.IsInstalled())
104 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
109 Dispose(DisposeTypes.Implicit);
113 Dispose(DisposeTypes.Explicit);
114 System.GC.SuppressFinalize(this);
118 protected virtual void Dispose(DisposeTypes type)
125 if (type == DisposeTypes.Explicit)
128 //Release your own managed resources here.
129 //You should release all of your own disposable objects here.
133 //Release your own unmanaged resources here.
134 //You should not access any managed member here except static instance.
135 //because the execution order of Finalizes is non-deterministic.
137 if (swigCPtr.Handle != global::System.IntPtr.Zero)
142 NDalicPINVOKE.delete_Model3dView_Property(swigCPtr);
144 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
150 public Property() : this(NDalicPINVOKE.new_Model3dView_Property(), true)
152 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
155 public static readonly int GEOMETRY_URL = NDalicPINVOKE.Model3dView_Property_GEOMETRY_URL_get();
156 public static readonly int MATERIAL_URL = NDalicPINVOKE.Model3dView_Property_MATERIAL_URL_get();
157 public static readonly int IMAGES_URL = NDalicPINVOKE.Model3dView_Property_IMAGES_URL_get();
158 public static readonly int ILLUMINATION_TYPE = NDalicPINVOKE.Model3dView_Property_ILLUMINATION_TYPE_get();
159 public static readonly int TEXTURE0_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE0_URL_get();
160 public static readonly int TEXTURE1_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE1_URL_get();
161 public static readonly int TEXTURE2_URL = NDalicPINVOKE.Model3dView_Property_TEXTURE2_URL_get();
162 public static readonly int LIGHT_POSITION = NDalicPINVOKE.Model3dView_Property_LIGHT_POSITION_get();
166 public Model3dView() : this(NDalicPINVOKE.Model3dView_New__SWIG_0(), true)
168 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public Model3dView(string objUrl, string mtlUrl, string imagesUrl) : this(NDalicPINVOKE.Model3dView_New__SWIG_1(objUrl, mtlUrl, imagesUrl), true)
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176 public Model3dView(Model3dView model3dView) : this(NDalicPINVOKE.new_Model3dView__SWIG_1(Model3dView.getCPtr(model3dView)), true)
178 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
181 public Model3dView Assign(Model3dView model3dView)
183 Model3dView ret = new Model3dView(NDalicPINVOKE.Model3dView_Assign(swigCPtr, Model3dView.getCPtr(model3dView)), false);
184 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 public new static Model3dView DownCast(BaseHandle handle)
190 Model3dView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Model3dView;
191 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public enum IluminationTypeEnum
198 DIFFUSE_WITH_TEXTURE,
199 DIFFUSE_WITH_NORMAL_MAP
202 public string GeometryUrl
207 GetProperty(Model3dView.Property.GEOMETRY_URL).Get(out temp);
212 SetProperty(Model3dView.Property.GEOMETRY_URL, new Tizen.NUI.PropertyValue(value));
215 public string MaterialUrl
220 GetProperty(Model3dView.Property.MATERIAL_URL).Get(out temp);
225 SetProperty(Model3dView.Property.MATERIAL_URL, new Tizen.NUI.PropertyValue(value));
228 public string ImagesUrl
233 GetProperty(Model3dView.Property.IMAGES_URL).Get(out temp);
238 SetProperty(Model3dView.Property.IMAGES_URL, new Tizen.NUI.PropertyValue(value));
241 public int IlluminationType
246 GetProperty(Model3dView.Property.ILLUMINATION_TYPE).Get(out temp);
251 SetProperty(Model3dView.Property.ILLUMINATION_TYPE, new Tizen.NUI.PropertyValue(value));
254 public string Texture0Url
259 GetProperty(Model3dView.Property.TEXTURE0_URL).Get(out temp);
264 SetProperty(Model3dView.Property.TEXTURE0_URL, new Tizen.NUI.PropertyValue(value));
267 public string Texture1Url
272 GetProperty(Model3dView.Property.TEXTURE1_URL).Get(out temp);
277 SetProperty(Model3dView.Property.TEXTURE1_URL, new Tizen.NUI.PropertyValue(value));
280 public string Texture2Url
285 GetProperty(Model3dView.Property.TEXTURE2_URL).Get(out temp);
290 SetProperty(Model3dView.Property.TEXTURE2_URL, new Tizen.NUI.PropertyValue(value));
293 public Vector3 LightPosition
297 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
298 GetProperty(Model3dView.Property.LIGHT_POSITION).Get(temp);
303 SetProperty(Model3dView.Property.LIGHT_POSITION, new Tizen.NUI.PropertyValue(value));