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.
20 internal class Camera : Animatable
22 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
24 internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CameraActor.CameraActor_SWIGUpcast(cPtr), cMemoryOwn)
26 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
29 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Camera obj)
31 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
34 protected override void Dispose(DisposeTypes type)
41 //Release your own unmanaged resources here.
42 //You should not access any managed member here except static instance.
43 //because the execution order of Finalizes is non-deterministic.
45 if (swigCPtr.Handle != global::System.IntPtr.Zero)
50 Interop.CameraActor.delete_CameraActor(swigCPtr);
52 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
58 internal class Property
60 internal static readonly int TYPE = Interop.CameraActor.CameraActor_Property_TYPE_get();
61 internal static readonly int PROJECTION_MODE = Interop.CameraActor.CameraActor_Property_PROJECTION_MODE_get();
62 internal static readonly int FIELD_OF_VIEW = Interop.CameraActor.CameraActor_Property_FIELD_OF_VIEW_get();
63 internal static readonly int ASPECT_RATIO = Interop.CameraActor.CameraActor_Property_ASPECT_RATIO_get();
64 internal static readonly int NEAR_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_NEAR_PLANE_DISTANCE_get();
65 internal static readonly int FAR_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_FAR_PLANE_DISTANCE_get();
66 internal static readonly int LEFT_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_LEFT_PLANE_DISTANCE_get();
67 internal static readonly int RIGHT_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_RIGHT_PLANE_DISTANCE_get();
68 internal static readonly int TOP_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_TOP_PLANE_DISTANCE_get();
69 internal static readonly int BOTTOM_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_BOTTOM_PLANE_DISTANCE_get();
70 internal static readonly int TARGET_POSITION = Interop.CameraActor.CameraActor_Property_TARGET_POSITION_get();
71 internal static readonly int PROJECTION_MATRIX = Interop.CameraActor.CameraActor_Property_PROJECTION_MATRIX_get();
72 internal static readonly int VIEW_MATRIX = Interop.CameraActor.CameraActor_Property_VIEW_MATRIX_get();
73 internal static readonly int INVERT_Y_AXIS = Interop.CameraActor.CameraActor_Property_INVERT_Y_AXIS_get();
76 public Camera() : this(Interop.CameraActor.CameraActor_New__SWIG_0(), true)
78 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81 public Camera(Vector2 size) : this(Interop.CameraActor.CameraActor_New__SWIG_1(Vector2.getCPtr(size)), true)
83 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86 public static Camera DownCast(BaseHandle handle)
88 Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera;
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93 public Camera(Camera copy) : this(Interop.CameraActor.new_CameraActor__SWIG_1(Camera.getCPtr(copy)), true)
95 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98 public Camera Assign(Camera rhs)
100 Camera ret = new Camera(Interop.CameraActor.CameraActor_Assign(swigCPtr, Camera.getCPtr(rhs)), false);
101 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
105 public void SetType(CameraType type)
107 Interop.CameraActor.CameraActor_SetType(swigCPtr, (int)type);
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
111 public new CameraType GetType()
113 CameraType ret = (CameraType)Interop.CameraActor.CameraActor_GetType(swigCPtr);
114 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
118 public void SetProjectionMode(ProjectionMode mode)
120 Interop.CameraActor.CameraActor_SetProjectionMode(swigCPtr, (int)mode);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 public ProjectionMode GetProjectionMode()
126 ProjectionMode ret = (ProjectionMode)Interop.CameraActor.CameraActor_GetProjectionMode(swigCPtr);
127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 public void SetFieldOfView(float fieldOfView)
133 Interop.CameraActor.CameraActor_SetFieldOfView(swigCPtr, fieldOfView);
134 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
137 public float GetFieldOfView()
139 float ret = Interop.CameraActor.CameraActor_GetFieldOfView(swigCPtr);
140 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
144 public void SetAspectRatio(float aspectRatio)
146 Interop.CameraActor.CameraActor_SetAspectRatio(swigCPtr, aspectRatio);
147 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150 public float GetAspectRatio()
152 float ret = Interop.CameraActor.CameraActor_GetAspectRatio(swigCPtr);
153 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
157 public void SetNearClippingPlane(float nearClippingPlane)
159 Interop.CameraActor.CameraActor_SetNearClippingPlane(swigCPtr, nearClippingPlane);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
163 public float GetNearClippingPlane()
165 float ret = Interop.CameraActor.CameraActor_GetNearClippingPlane(swigCPtr);
166 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 public void SetFarClippingPlane(float farClippingPlane)
172 Interop.CameraActor.CameraActor_SetFarClippingPlane(swigCPtr, farClippingPlane);
173 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
176 public float GetFarClippingPlane()
178 float ret = Interop.CameraActor.CameraActor_GetFarClippingPlane(swigCPtr);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183 public void SetTargetPosition(Vector3 targetPosition)
185 Interop.CameraActor.CameraActor_SetTargetPosition(swigCPtr, Vector3.getCPtr(targetPosition));
186 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
189 public Vector3 GetTargetPosition()
191 Vector3 ret = new Vector3(Interop.CameraActor.CameraActor_GetTargetPosition(swigCPtr), true);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
196 public void SetInvertYAxis(bool invertYAxis)
198 Interop.CameraActor.CameraActor_SetInvertYAxis(swigCPtr, invertYAxis);
199 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 public bool GetInvertYAxis()
204 bool ret = Interop.CameraActor.CameraActor_GetInvertYAxis(swigCPtr);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 public void SetPerspectiveProjection(Vector2 size)
211 Interop.CameraActor.CameraActor_SetPerspectiveProjection(swigCPtr, Vector2.getCPtr(size));
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 public void SetOrthographicProjection(Vector2 size)
217 Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_0(swigCPtr, Vector2.getCPtr(size));
218 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 public void SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
223 Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_1(swigCPtr, left, right, top, bottom, near, far);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 GetProperty(Camera.Property.TYPE).Get(out temp);
237 SetProperty(Camera.Property.TYPE, new Tizen.NUI.PropertyValue(value));
240 public string ProjectionMode
245 GetProperty(Camera.Property.PROJECTION_MODE).Get(out temp);
250 SetProperty(Camera.Property.PROJECTION_MODE, new Tizen.NUI.PropertyValue(value));
253 public float FieldOfView
258 GetProperty(Camera.Property.FIELD_OF_VIEW).Get(out temp);
263 SetProperty(Camera.Property.FIELD_OF_VIEW, new Tizen.NUI.PropertyValue(value));
266 public float AspectRatio
271 GetProperty(Camera.Property.ASPECT_RATIO).Get(out temp);
276 SetProperty(Camera.Property.ASPECT_RATIO, new Tizen.NUI.PropertyValue(value));
279 public float NearPlaneDistance
284 GetProperty(Camera.Property.NEAR_PLANE_DISTANCE).Get(out temp);
289 SetProperty(Camera.Property.NEAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
292 public float FarPlaneDistance
297 GetProperty(Camera.Property.FAR_PLANE_DISTANCE).Get(out temp);
302 SetProperty(Camera.Property.FAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
305 public float LeftPlaneDistance
310 GetProperty(Camera.Property.LEFT_PLANE_DISTANCE).Get(out temp);
315 SetProperty(Camera.Property.LEFT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
318 public float RightPlaneDistance
323 GetProperty(Camera.Property.RIGHT_PLANE_DISTANCE).Get(out temp);
328 SetProperty(Camera.Property.RIGHT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
331 public float TopPlaneDistance
336 GetProperty(Camera.Property.TOP_PLANE_DISTANCE).Get(out temp);
341 SetProperty(Camera.Property.TOP_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
344 public float BottomPlaneDistance
349 GetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE).Get(out temp);
354 SetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
357 public Vector3 TargetPosition
361 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
362 GetProperty(Camera.Property.TARGET_POSITION).Get(temp);
367 SetProperty(Camera.Property.TARGET_POSITION, new Tizen.NUI.PropertyValue(value));
370 internal Matrix ProjectionMatrix
374 Matrix temp = new Matrix();
375 GetProperty(Camera.Property.PROJECTION_MATRIX).Get(temp);
379 internal Matrix ViewMatrix
383 Matrix temp = new Matrix();
384 GetProperty(Camera.Property.VIEW_MATRIX).Get(temp);
388 public bool InvertYAxis
393 GetProperty(Camera.Property.INVERT_Y_AXIS).Get(out temp);
398 SetProperty(Camera.Property.INVERT_Y_AXIS, new Tizen.NUI.PropertyValue(value));