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 System.ComponentModel;
19 using Tizen.NUI.BaseComponents;
23 /// This will be released at Tizen.NET API Level 6, so currently this would be used as inhouse API.
24 [EditorBrowsable(EditorBrowsableState.Never)]
25 public class Camera : View
28 internal Camera(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.CameraActor.CameraActor_SWIGUpcast(cPtr), cMemoryOwn)
32 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Camera obj)
34 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
37 protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
39 Interop.CameraActor.delete_CameraActor(swigCPtr);
42 internal class Property
44 internal static readonly int TYPE = Interop.CameraActor.CameraActor_Property_TYPE_get();
45 internal static readonly int PROJECTION_MODE = Interop.CameraActor.CameraActor_Property_PROJECTION_MODE_get();
46 internal static readonly int FIELD_OF_VIEW = Interop.CameraActor.CameraActor_Property_FIELD_OF_VIEW_get();
47 internal static readonly int ASPECT_RATIO = Interop.CameraActor.CameraActor_Property_ASPECT_RATIO_get();
48 internal static readonly int NEAR_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_NEAR_PLANE_DISTANCE_get();
49 internal static readonly int FAR_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_FAR_PLANE_DISTANCE_get();
50 internal static readonly int LEFT_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_LEFT_PLANE_DISTANCE_get();
51 internal static readonly int RIGHT_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_RIGHT_PLANE_DISTANCE_get();
52 internal static readonly int TOP_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_TOP_PLANE_DISTANCE_get();
53 internal static readonly int BOTTOM_PLANE_DISTANCE = Interop.CameraActor.CameraActor_Property_BOTTOM_PLANE_DISTANCE_get();
54 internal static readonly int TARGET_POSITION = Interop.CameraActor.CameraActor_Property_TARGET_POSITION_get();
55 internal static readonly int PROJECTION_MATRIX = Interop.CameraActor.CameraActor_Property_PROJECTION_MATRIX_get();
56 internal static readonly int VIEW_MATRIX = Interop.CameraActor.CameraActor_Property_VIEW_MATRIX_get();
57 internal static readonly int INVERT_Y_AXIS = Interop.CameraActor.CameraActor_Property_INVERT_Y_AXIS_get();
60 public Camera() : this(Interop.CameraActor.CameraActor_New__SWIG_0(), true)
62 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
65 public Camera(Vector2 size) : this(Interop.CameraActor.CameraActor_New__SWIG_1(Vector2.getCPtr(size)), true)
67 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
70 public static Camera DownCast(BaseHandle handle)
72 Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera;
73 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
77 public Camera(Camera copy) : this(Interop.CameraActor.new_CameraActor__SWIG_1(Camera.getCPtr(copy)), true)
79 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 public Camera Assign(Camera rhs)
84 Camera ret = new Camera(Interop.CameraActor.CameraActor_Assign(swigCPtr, Camera.getCPtr(rhs)), false);
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 public void SetType(CameraType type)
91 Interop.CameraActor.CameraActor_SetType(swigCPtr, (int)type);
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
95 public new CameraType GetType()
97 CameraType ret = (CameraType)Interop.CameraActor.CameraActor_GetType(swigCPtr);
98 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
102 public void SetProjectionMode(ProjectionMode mode)
104 Interop.CameraActor.CameraActor_SetProjectionMode(swigCPtr, (int)mode);
105 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
108 public ProjectionMode GetProjectionMode()
110 ProjectionMode ret = (ProjectionMode)Interop.CameraActor.CameraActor_GetProjectionMode(swigCPtr);
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 public void SetFieldOfView(float fieldOfView)
117 Interop.CameraActor.CameraActor_SetFieldOfView(swigCPtr, fieldOfView);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 public float GetFieldOfView()
123 float ret = Interop.CameraActor.CameraActor_GetFieldOfView(swigCPtr);
124 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
128 public void SetAspectRatio(float aspectRatio)
130 Interop.CameraActor.CameraActor_SetAspectRatio(swigCPtr, aspectRatio);
131 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 public float GetAspectRatio()
136 float ret = Interop.CameraActor.CameraActor_GetAspectRatio(swigCPtr);
137 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
141 public void SetNearClippingPlane(float nearClippingPlane)
143 Interop.CameraActor.CameraActor_SetNearClippingPlane(swigCPtr, nearClippingPlane);
144 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
147 public float GetNearClippingPlane()
149 float ret = Interop.CameraActor.CameraActor_GetNearClippingPlane(swigCPtr);
150 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 public void SetFarClippingPlane(float farClippingPlane)
156 Interop.CameraActor.CameraActor_SetFarClippingPlane(swigCPtr, farClippingPlane);
157 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160 public float GetFarClippingPlane()
162 float ret = Interop.CameraActor.CameraActor_GetFarClippingPlane(swigCPtr);
163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
167 public void SetTargetPosition(Vector3 targetPosition)
169 Interop.CameraActor.CameraActor_SetTargetPosition(swigCPtr, Vector3.getCPtr(targetPosition));
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
173 public Vector3 GetTargetPosition()
175 Vector3 ret = new Vector3(Interop.CameraActor.CameraActor_GetTargetPosition(swigCPtr), true);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 public void SetInvertYAxis(bool invertYAxis)
182 Interop.CameraActor.CameraActor_SetInvertYAxis(swigCPtr, invertYAxis);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
186 public bool GetInvertYAxis()
188 bool ret = Interop.CameraActor.CameraActor_GetInvertYAxis(swigCPtr);
189 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193 public void SetPerspectiveProjection(Vector2 size)
195 Interop.CameraActor.CameraActor_SetPerspectiveProjection(swigCPtr, Vector2.getCPtr(size));
196 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
199 public void SetOrthographicProjection(Vector2 size)
201 Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_0(swigCPtr, Vector2.getCPtr(size));
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 public void SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
207 Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_1(swigCPtr, left, right, top, bottom, near, far);
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
216 GetProperty(Camera.Property.TYPE).Get(out temp);
221 SetProperty(Camera.Property.TYPE, new Tizen.NUI.PropertyValue(value));
224 public string ProjectionMode
229 GetProperty(Camera.Property.PROJECTION_MODE).Get(out temp);
234 SetProperty(Camera.Property.PROJECTION_MODE, new Tizen.NUI.PropertyValue(value));
237 public float FieldOfView
242 GetProperty(Camera.Property.FIELD_OF_VIEW).Get(out temp);
247 SetProperty(Camera.Property.FIELD_OF_VIEW, new Tizen.NUI.PropertyValue(value));
250 public float AspectRatio
255 GetProperty(Camera.Property.ASPECT_RATIO).Get(out temp);
260 SetProperty(Camera.Property.ASPECT_RATIO, new Tizen.NUI.PropertyValue(value));
263 public float NearPlaneDistance
268 GetProperty(Camera.Property.NEAR_PLANE_DISTANCE).Get(out temp);
273 SetProperty(Camera.Property.NEAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
276 public float FarPlaneDistance
281 GetProperty(Camera.Property.FAR_PLANE_DISTANCE).Get(out temp);
286 SetProperty(Camera.Property.FAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
289 public float LeftPlaneDistance
294 GetProperty(Camera.Property.LEFT_PLANE_DISTANCE).Get(out temp);
299 SetProperty(Camera.Property.LEFT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
302 public float RightPlaneDistance
307 GetProperty(Camera.Property.RIGHT_PLANE_DISTANCE).Get(out temp);
312 SetProperty(Camera.Property.RIGHT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
315 public float TopPlaneDistance
320 GetProperty(Camera.Property.TOP_PLANE_DISTANCE).Get(out temp);
325 SetProperty(Camera.Property.TOP_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
328 public float BottomPlaneDistance
333 GetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE).Get(out temp);
338 SetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
341 public Vector3 TargetPosition
345 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
346 GetProperty(Camera.Property.TARGET_POSITION).Get(temp);
351 SetProperty(Camera.Property.TARGET_POSITION, new Tizen.NUI.PropertyValue(value));
354 internal Matrix ProjectionMatrix
358 Matrix temp = new Matrix();
359 GetProperty(Camera.Property.PROJECTION_MATRIX).Get(temp);
363 internal Matrix ViewMatrix
367 Matrix temp = new Matrix();
368 GetProperty(Camera.Property.VIEW_MATRIX).Get(temp);
372 public bool InvertYAxis
377 GetProperty(Camera.Property.INVERT_Y_AXIS).Get(out temp);
382 SetProperty(Camera.Property.INVERT_Y_AXIS, new Tizen.NUI.PropertyValue(value));