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)
74 throw new global::System.ArgumentNullException(nameof(handle));
76 Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera;
77 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
81 public Camera(Camera copy) : this(Interop.CameraActor.new_CameraActor__SWIG_1(Camera.getCPtr(copy)), true)
83 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
86 public Camera Assign(Camera rhs)
88 Camera ret = new Camera(Interop.CameraActor.CameraActor_Assign(swigCPtr, Camera.getCPtr(rhs)), false);
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
93 public void SetType(CameraType type)
95 Interop.CameraActor.CameraActor_SetType(swigCPtr, (int)type);
96 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 public new CameraType GetType()
101 CameraType ret = (CameraType)Interop.CameraActor.CameraActor_GetType(swigCPtr);
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106 public void SetProjectionMode(ProjectionMode mode)
108 Interop.CameraActor.CameraActor_SetProjectionMode(swigCPtr, (int)mode);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112 public ProjectionMode GetProjectionMode()
114 ProjectionMode ret = (ProjectionMode)Interop.CameraActor.CameraActor_GetProjectionMode(swigCPtr);
115 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
119 public void SetFieldOfView(float fieldOfView)
121 Interop.CameraActor.CameraActor_SetFieldOfView(swigCPtr, fieldOfView);
122 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 public float GetFieldOfView()
127 float ret = Interop.CameraActor.CameraActor_GetFieldOfView(swigCPtr);
128 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132 public void SetAspectRatio(float aspectRatio)
134 Interop.CameraActor.CameraActor_SetAspectRatio(swigCPtr, aspectRatio);
135 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
138 public float GetAspectRatio()
140 float ret = Interop.CameraActor.CameraActor_GetAspectRatio(swigCPtr);
141 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
145 public void SetNearClippingPlane(float nearClippingPlane)
147 Interop.CameraActor.CameraActor_SetNearClippingPlane(swigCPtr, nearClippingPlane);
148 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 public float GetNearClippingPlane()
153 float ret = Interop.CameraActor.CameraActor_GetNearClippingPlane(swigCPtr);
154 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 public void SetFarClippingPlane(float farClippingPlane)
160 Interop.CameraActor.CameraActor_SetFarClippingPlane(swigCPtr, farClippingPlane);
161 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 public float GetFarClippingPlane()
166 float ret = Interop.CameraActor.CameraActor_GetFarClippingPlane(swigCPtr);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
171 public void SetTargetPosition(Vector3 targetPosition)
173 Interop.CameraActor.CameraActor_SetTargetPosition(swigCPtr, Vector3.getCPtr(targetPosition));
174 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 public Vector3 GetTargetPosition()
179 Vector3 ret = new Vector3(Interop.CameraActor.CameraActor_GetTargetPosition(swigCPtr), true);
180 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 public void SetInvertYAxis(bool invertYAxis)
186 Interop.CameraActor.CameraActor_SetInvertYAxis(swigCPtr, invertYAxis);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public bool GetInvertYAxis()
192 bool ret = Interop.CameraActor.CameraActor_GetInvertYAxis(swigCPtr);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197 public void SetPerspectiveProjection(Vector2 size)
199 Interop.CameraActor.CameraActor_SetPerspectiveProjection(swigCPtr, Vector2.getCPtr(size));
200 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203 public void SetOrthographicProjection(Vector2 size)
205 Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_0(swigCPtr, Vector2.getCPtr(size));
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209 public void SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
211 Interop.CameraActor.CameraActor_SetOrthographicProjection__SWIG_1(swigCPtr, left, right, top, bottom, near, far);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 GetProperty(Camera.Property.TYPE).Get(out temp);
225 SetProperty(Camera.Property.TYPE, new Tizen.NUI.PropertyValue(value));
228 public string ProjectionMode
233 GetProperty(Camera.Property.PROJECTION_MODE).Get(out temp);
238 SetProperty(Camera.Property.PROJECTION_MODE, new Tizen.NUI.PropertyValue(value));
241 public float FieldOfView
246 GetProperty(Camera.Property.FIELD_OF_VIEW).Get(out temp);
251 SetProperty(Camera.Property.FIELD_OF_VIEW, new Tizen.NUI.PropertyValue(value));
254 public float AspectRatio
259 GetProperty(Camera.Property.ASPECT_RATIO).Get(out temp);
264 SetProperty(Camera.Property.ASPECT_RATIO, new Tizen.NUI.PropertyValue(value));
267 public float NearPlaneDistance
272 GetProperty(Camera.Property.NEAR_PLANE_DISTANCE).Get(out temp);
277 SetProperty(Camera.Property.NEAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
280 public float FarPlaneDistance
285 GetProperty(Camera.Property.FAR_PLANE_DISTANCE).Get(out temp);
290 SetProperty(Camera.Property.FAR_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
293 public float LeftPlaneDistance
298 GetProperty(Camera.Property.LEFT_PLANE_DISTANCE).Get(out temp);
303 SetProperty(Camera.Property.LEFT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
306 public float RightPlaneDistance
311 GetProperty(Camera.Property.RIGHT_PLANE_DISTANCE).Get(out temp);
316 SetProperty(Camera.Property.RIGHT_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
319 public float TopPlaneDistance
324 GetProperty(Camera.Property.TOP_PLANE_DISTANCE).Get(out temp);
329 SetProperty(Camera.Property.TOP_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
332 public float BottomPlaneDistance
337 GetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE).Get(out temp);
342 SetProperty(Camera.Property.BOTTOM_PLANE_DISTANCE, new Tizen.NUI.PropertyValue(value));
345 public Vector3 TargetPosition
349 Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
350 GetProperty(Camera.Property.TARGET_POSITION).Get(temp);
355 SetProperty(Camera.Property.TARGET_POSITION, new Tizen.NUI.PropertyValue(value));
358 internal Matrix ProjectionMatrix
362 Matrix temp = new Matrix();
363 GetProperty(Camera.Property.PROJECTION_MATRIX).Get(temp);
367 internal Matrix ViewMatrix
371 Matrix temp = new Matrix();
372 GetProperty(Camera.Property.VIEW_MATRIX).Get(temp);
376 public bool InvertYAxis
381 GetProperty(Camera.Property.INVERT_Y_AXIS).Get(out temp);
386 SetProperty(Camera.Property.INVERT_Y_AXIS, new Tizen.NUI.PropertyValue(value));