[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation_2")]
public static extern global::System.IntPtr NewRotation2(global::System.Runtime.InteropServices.HandleRef v0, global::System.Runtime.InteropServices.HandleRef v1);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation_3")]
+ public static extern global::System.IntPtr NewRotation3(global::System.Runtime.InteropServices.HandleRef pitch, global::System.Runtime.InteropServices.HandleRef yaw, global::System.Runtime.InteropServices.HandleRef roll);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Rotation")]
public static extern void DeleteRotation(global::System.Runtime.InteropServices.HandleRef rotation);
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
public static extern bool GetAxisAngle(global::System.Runtime.InteropServices.HandleRef rotation, global::System.Runtime.InteropServices.HandleRef axis, global::System.Runtime.InteropServices.HandleRef radianAngle);
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_SetEulerAngle")]
+ public static extern void SetEulerAngle(global::System.Runtime.InteropServices.HandleRef rotation, global::System.Runtime.InteropServices.HandleRef pitch, global::System.Runtime.InteropServices.HandleRef yaw, global::System.Runtime.InteropServices.HandleRef roll);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_GetEulerAngle")]
+ public static extern void GetEulerAngle(global::System.Runtime.InteropServices.HandleRef rotation, global::System.Runtime.InteropServices.HandleRef pitch, global::System.Runtime.InteropServices.HandleRef yaw, global::System.Runtime.InteropServices.HandleRef roll);
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Add")]
public static extern global::System.IntPtr Add(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
}
/// <summary>
+ /// The constructor of Rotation from Euler angles.
+ /// </summary>
+ /// <param name="pitch">Pitch value as Radian.</param>
+ /// <param name="yaw">Yaw value as Radian</param>
+ /// <param name="roll">Roll value as Radian</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Rotation(Radian pitch, Radian yaw, Radian roll) : this(Interop.Rotation.NewRotation3(Radian.getCPtr(pitch), Radian.getCPtr(yaw), Radian.getCPtr(roll)), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
/// (0.0f,0.0f,0.0f,1.0f).
/// </summary>
/// <since_tizen> 3 </since_tizen>
}
/// <summary>
+ /// Set the quaternion from Euler angles.
+ /// </summary>
+ /// <param name="pitch">Pitch value as Radian.</param>
+ /// <param name="yaw">Yaw value as Radian</param>
+ /// <param name="roll">Roll value as Radian</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetEulerAngle(Radian pitch, Radian yaw, Radian roll)
+ {
+ Interop.Rotation.SetEulerAngle(SwigCPtr, Radian.getCPtr(pitch), Radian.getCPtr(yaw), Radian.getCPtr(roll));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// Get the Euler angles from this quaternion.
+ /// </summary>
+ /// <param name="pitch">The result of pitch value as Radian.</param>
+ /// <param name="yaw">The result of yaw value as Radian</param>
+ /// <param name="roll">The result of roll value as Radian</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void GetEulerAngle(Radian pitch, Radian yaw, Radian roll)
+ {
+ Interop.Rotation.GetEulerAngle(SwigCPtr, Radian.getCPtr(pitch), Radian.getCPtr(yaw), Radian.getCPtr(roll));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
/// Returns the length of the rotation.
/// </summary>
/// <returns>The length of the rotation.</returns>
--- /dev/null
+using global::System;
+using NUnit.Framework;
+using NUnit.Framework.TUnit;
+using Tizen.NUI;
+
+namespace Tizen.NUI.Devel.Tests
+{
+ using tlog = Tizen.Log;
+
+ [TestFixture]
+ [Description("public/Common/Rotation")]
+ public class RotationTest
+ {
+ private const string tag = "NUITEST";
+
+ [SetUp]
+ public void Init()
+ {
+ tlog.Info(tag, "Init() is called!");
+ }
+
+ [TearDown]
+ public void Destroy()
+ {
+ tlog.Info(tag, "Destroy() is called!");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Rotation constructor. With Euler Angles")]
+ [Property("SPEC", "Tizen.NUI.Rotation.Rotation C")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "CONSTR")]
+ [Property("AUTHOR", "eunkiki.hong@samsung.com")]
+ public void RotationConstructorWithEulerAngle()
+ {
+ tlog.Debug(tag, $"RotationConstructorWithEulerAngle START");
+
+ var testingTarget = new Rotation(new Radian(new Degree(30.0f)), new Radian(new Degree(45.0f)), new Radian(new Degree(60.0f)));
+ Assert.IsNotNull(testingTarget, "Can't create success object Rotation.");
+ Assert.IsInstanceOf<Rotation>(testingTarget, "Should return Rotation instance.");
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RotationConstructorWithEulerAngle END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Rotation SetEulerAngle.")]
+ [Property("SPEC", "Tizen.NUI.Rotation.SetEulerAngle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "eunkiki.hong@samsung.com")]
+ public void RotationSetEulerAngle()
+ {
+ tlog.Debug(tag, $"RotationSetEulerAngle START");
+
+ var testingTarget = new Rotation();
+ Assert.IsNotNull(testingTarget, "Can't create success object Rotation.");
+ Assert.IsInstanceOf<Rotation>(testingTarget, "Should return Rotation instance.");
+
+ try
+ {
+ testingTarget.SetEulerAngle(new Radian(new Degree(30.0f)), new Radian(new Degree(45.0f)), new Radian(new Degree(60.0f)));
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RotationSetEulerAngle END (OK)");
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Rotation GetEulerAngle.")]
+ [Property("SPEC", "Tizen.NUI.Rotation.GetEulerAngle M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("AUTHOR", "eunkiki.hong@samsung.com")]
+ public void RotationGetEulerAngle()
+ {
+ tlog.Debug(tag, $"RotationGetEulerAngle START");
+
+ var expectPitchRadian = new Radian(new Degree(30.0f));
+ var expectYawRadian = new Radian(new Degree(45.0f));
+ var expectRollRadian = new Radian(new Degree(60.0f));
+ var testingTarget = new Rotation(expectPitchRadian, expectYawRadian, expectRollRadian);
+ Assert.IsNotNull(testingTarget, "Can't create success object Rotation.");
+ Assert.IsInstanceOf<Rotation>(testingTarget, "Should return Rotation instance.");
+
+ try
+ {
+ using var pitch = new Radian();
+ using var yaw = new Radian();
+ using var roll = new Radian();
+ testingTarget.GetEulerAngle(pitch, yaw, roll);
+
+ Assert.AreEqual(expectPitchRadian.Value, pitch.Value, 0.001, "Pitch value should be same");
+ Assert.AreEqual(expectYawRadian.Value, yaw.Value, 0.001, "Yaw value should be same");
+ Assert.AreEqual(expectRollRadian.Value, roll.Value, 0.001, "Roll value should be same");
+ }
+ catch (Exception e)
+ {
+ tlog.Debug(tag, e.Message.ToString());
+ Assert.Fail("Caught Exception : Failed!");
+ }
+
+ testingTarget.Dispose();
+ tlog.Debug(tag, $"RotationGetEulerAngle END (OK)");
+ }
+ }
+}