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.
21 internal class Camera : Animatable
23 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
25 internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.CameraActor_SWIGUpcast(cPtr), cMemoryOwn)
27 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
30 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Camera obj)
32 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
35 protected override void Dispose(DisposeTypes type)
42 if (type == DisposeTypes.Explicit)
45 //Release your own managed resources here.
46 //You should release all of your own disposable objects here.
50 //Release your own unmanaged resources here.
51 //You should not access any managed member here except static instance.
52 //because the execution order of Finalizes is non-deterministic.
54 if (swigCPtr.Handle != global::System.IntPtr.Zero)
59 NDalicPINVOKE.delete_CameraActor(swigCPtr);
61 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
69 /// <since_tizen> 3 </since_tizen>
70 public 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;
97 isDisposeQueued = true;
98 DisposeQueue.Instance.Add(this);
102 /// <since_tizen> 3 </since_tizen>
103 public void Dispose()
105 //Throw excpetion if Dispose() is called in separate thread.
106 if (!Window.IsInstalled())
108 throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
113 Dispose(DisposeTypes.Implicit);
117 Dispose(DisposeTypes.Explicit);
118 System.GC.SuppressFinalize(this);
122 /// <since_tizen> 3 </since_tizen>
123 protected virtual void Dispose(DisposeTypes type)
130 if (type == DisposeTypes.Explicit)
133 //Release your own managed resources here.
134 //You should release all of your own disposable objects here.
138 //Release your own unmanaged resources here.
139 //You should not access any managed member here except static instance.
140 //because the execution order of Finalizes is non-deterministic.
142 if (swigCPtr.Handle != global::System.IntPtr.Zero)
147 NDalicPINVOKE.delete_CameraActor_Property(swigCPtr);
149 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
156 /// <since_tizen> 3 </since_tizen>
157 public Property() : this(NDalicPINVOKE.new_CameraActor_Property(), true)
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 /// <since_tizen> 3 </since_tizen>
163 public static readonly int TYPE = NDalicPINVOKE.CameraActor_Property_TYPE_get();
164 /// <since_tizen> 3 </since_tizen>
165 public static readonly int PROJECTION_MODE = NDalicPINVOKE.CameraActor_Property_PROJECTION_MODE_get();
166 /// <since_tizen> 3 </since_tizen>
167 public static readonly int FIELD_OF_VIEW = NDalicPINVOKE.CameraActor_Property_FIELD_OF_VIEW_get();
168 /// <since_tizen> 3 </since_tizen>
169 public static readonly int ASPECT_RATIO = NDalicPINVOKE.CameraActor_Property_ASPECT_RATIO_get();
170 /// <since_tizen> 3 </since_tizen>
171 public static readonly int NEAR_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_NEAR_PLANE_DISTANCE_get();
172 /// <since_tizen> 3 </since_tizen>
173 public static readonly int FAR_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_FAR_PLANE_DISTANCE_get();
174 /// <since_tizen> 3 </since_tizen>
175 public static readonly int LEFT_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_LEFT_PLANE_DISTANCE_get();
176 /// <since_tizen> 3 </since_tizen>
177 public static readonly int RIGHT_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_RIGHT_PLANE_DISTANCE_get();
178 /// <since_tizen> 3 </since_tizen>
179 public static readonly int TOP_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_TOP_PLANE_DISTANCE_get();
180 /// <since_tizen> 3 </since_tizen>
181 public static readonly int BOTTOM_PLANE_DISTANCE = NDalicPINVOKE.CameraActor_Property_BOTTOM_PLANE_DISTANCE_get();
182 /// <since_tizen> 3 </since_tizen>
183 public static readonly int TARGET_POSITION = NDalicPINVOKE.CameraActor_Property_TARGET_POSITION_get();
184 /// <since_tizen> 3 </since_tizen>
185 public static readonly int PROJECTION_MATRIX = NDalicPINVOKE.CameraActor_Property_PROJECTION_MATRIX_get();
186 /// <since_tizen> 3 </since_tizen>
187 public static readonly int VIEW_MATRIX = NDalicPINVOKE.CameraActor_Property_VIEW_MATRIX_get();
188 /// <since_tizen> 3 </since_tizen>
189 public static readonly int INVERT_Y_AXIS = NDalicPINVOKE.CameraActor_Property_INVERT_Y_AXIS_get();
193 public Camera() : this(NDalicPINVOKE.CameraActor_New__SWIG_0(), true)
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 public Camera(Vector2 size) : this(NDalicPINVOKE.CameraActor_New__SWIG_1(Vector2.getCPtr(size)), true)
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 public static Camera DownCast(BaseHandle handle)
205 Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera;
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 public Camera(Camera copy) : this(NDalicPINVOKE.new_CameraActor__SWIG_1(Camera.getCPtr(copy)), true)
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 public Camera Assign(Camera rhs)
217 Camera ret = new Camera(NDalicPINVOKE.CameraActor_Assign(swigCPtr, Camera.getCPtr(rhs)), false);
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 public void SetType(CameraType type)
224 NDalicPINVOKE.CameraActor_SetType(swigCPtr, (int)type);
225 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228 public new CameraType GetType()
230 CameraType ret = (CameraType)NDalicPINVOKE.CameraActor_GetType(swigCPtr);
231 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235 public void SetProjectionMode(ProjectionMode mode)
237 NDalicPINVOKE.CameraActor_SetProjectionMode(swigCPtr, (int)mode);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 public ProjectionMode GetProjectionMode()
243 ProjectionMode ret = (ProjectionMode)NDalicPINVOKE.CameraActor_GetProjectionMode(swigCPtr);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 public void SetFieldOfView(float fieldOfView)
250 NDalicPINVOKE.CameraActor_SetFieldOfView(swigCPtr, fieldOfView);
251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 public float GetFieldOfView()
256 float ret = NDalicPINVOKE.CameraActor_GetFieldOfView(swigCPtr);
257 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 public void SetAspectRatio(float aspectRatio)
263 NDalicPINVOKE.CameraActor_SetAspectRatio(swigCPtr, aspectRatio);
264 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
267 public float GetAspectRatio()
269 float ret = NDalicPINVOKE.CameraActor_GetAspectRatio(swigCPtr);
270 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
274 public void SetNearClippingPlane(float nearClippingPlane)
276 NDalicPINVOKE.CameraActor_SetNearClippingPlane(swigCPtr, nearClippingPlane);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 public float GetNearClippingPlane()
282 float ret = NDalicPINVOKE.CameraActor_GetNearClippingPlane(swigCPtr);
283 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
287 public void SetFarClippingPlane(float farClippingPlane)
289 NDalicPINVOKE.CameraActor_SetFarClippingPlane(swigCPtr, farClippingPlane);
290 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
293 public float GetFarClippingPlane()
295 float ret = NDalicPINVOKE.CameraActor_GetFarClippingPlane(swigCPtr);
296 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 public void SetTargetPosition(Vector3 targetPosition)
302 NDalicPINVOKE.CameraActor_SetTargetPosition(swigCPtr, Vector3.getCPtr(targetPosition));
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
306 public Vector3 GetTargetPosition()
308 Vector3 ret = new Vector3(NDalicPINVOKE.CameraActor_GetTargetPosition(swigCPtr), true);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
313 public void SetInvertYAxis(bool invertYAxis)
315 NDalicPINVOKE.CameraActor_SetInvertYAxis(swigCPtr, invertYAxis);
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
319 public bool GetInvertYAxis()
321 bool ret = NDalicPINVOKE.CameraActor_GetInvertYAxis(swigCPtr);
322 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 public void SetPerspectiveProjection(Vector2 size)
328 NDalicPINVOKE.CameraActor_SetPerspectiveProjection(swigCPtr, Vector2.getCPtr(size));
329 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332 public void SetOrthographicProjection(Vector2 size)
334 NDalicPINVOKE.CameraActor_SetOrthographicProjection__SWIG_0(swigCPtr, Vector2.getCPtr(size));
335 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
338 public void SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
340 NDalicPINVOKE.CameraActor_SetOrthographicProjection__SWIG_1(swigCPtr, left, right, top, bottom, near, far);
341 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 GetProperty(Camera.Property.TYPE).Get(out temp);
354 SetProperty(Camera.Property.TYPE, new Tizen.NUI.PropertyValue(value));
357 public string ProjectionMode
362 GetProperty(Camera.Property.PROJECTION_MODE).Get(out temp);
367 SetProperty(Camera.Property.PROJECTION_MODE, new Tizen.NUI.PropertyValue(value));
370 public float FieldOfView
375 GetProperty(Camera.Property.FIELD_OF_VIEW).Get(out temp);
380 SetProperty(Camera.Property.FIELD_OF_VIEW, new Tizen.NUI.PropertyValue(value));
383 public float AspectRatio
388 GetProperty(Camera.Property.ASPECT_RATIO).Get(out temp);
393 SetProperty(Camera.Property.ASPECT_RATIO, new Tizen.NUI.PropertyValue(value));
396 public float NearPlaneDistance
401 GetProperty(Camera.Property.NEAR_PLANE_DISTANCE).Get(out temp);
406 SetProperty(Camera.Property.NEAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
409 public float FarPlaneDistance
414 GetProperty(Camera.Property.FAR_PLANE_DISTANCE).Get(out temp);
419 SetProperty(Camera.Property.FAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
422 public float LeftPlaneDistance
427 GetProperty(Camera.Property.LEFT_PLANE_DISTANCE).Get(out temp);
432 SetProperty(Camera.Property.LEFT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
435 public float RightPlaneDistance
440 GetProperty(Camera.Property.RIGHT_PLANE_DISTANCE).Get(out temp);
445 SetProperty(Camera.Property.RIGHT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
448 public float TopPlaneDistance
453 GetProperty(Camera.Property.TOP_PLANE_DISTANCE).Get(out temp);
458 SetProperty(Camera.Property.TOP_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
461 public float BottomPlaneDistance
466 GetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE).Get(out temp);
471 SetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
474 public Vector3 TargetPosition
478 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
479 GetProperty(Camera.Property.TARGET_POSITION).Get(temp);
484 SetProperty(Camera.Property.TARGET_POSITION, new Tizen.NUI.PropertyValue(value));
487 internal Matrix ProjectionMatrix
491 Matrix temp = new Matrix();
492 GetProperty(Camera.Property.PROJECTION_MATRIX).Get(temp);
496 internal Matrix ViewMatrix
500 Matrix temp = new Matrix();
501 GetProperty(Camera.Property.VIEW_MATRIX).Get(temp);
505 public bool InvertYAxis
510 GetProperty(Camera.Property.INVERT_Y_AXIS).Get(out temp);
515 SetProperty(Camera.Property.INVERT_Y_AXIS, new Tizen.NUI.PropertyValue(value));