Rotation High Level Class support in C# 58/116058/3
authorUmar <m.umar@partner.samsung.com>
Wed, 22 Feb 2017 17:35:08 +0000 (17:35 +0000)
committerUmar <m.umar@partner.samsung.com>
Thu, 23 Feb 2017 17:36:16 +0000 (17:36 +0000)
Change-Id: I4e1435658df795bbdb3c311e5158cd9932d338e2

plugins/dali-swig/SWIG/dali-gc.i
plugins/dali-swig/SWIG/dali-operator.i
plugins/dali-swig/SWIG/dali.i
plugins/dali-swig/SWIG/rotation.i [new file with mode: 0755]
plugins/dali-swig/examples/hello-world.cs
plugins/dali-swig/examples/scroll-view.cs
plugins/dali-swig/property-wrapper.rb

index 808cd07..8017ecc 100644 (file)
@@ -290,8 +290,8 @@ DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, RelayoutContainer );
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Radian );
 DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, Radian );
 
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Radian );
 DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, Radian );
 
-DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Quaternion );
-DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, Quaternion );
+DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION_RENAME( Dali, Quaternion, Rotation );
+DALI_CREATE_CUSTOM_DISPOSE_FUNCTION_RENAME( Dali, Quaternion, Rotation );
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Matrix );
 DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, Matrix );
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Matrix3 );
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Matrix );
 DALI_CREATE_CUSTOM_DISPOSE_FUNCTION( Dali, Matrix );
 DALI_CREATE_CUSTOM_DESTRUCTOR_FUNCTION( Dali, Matrix3 );
index 894b34f..29ed172 100644 (file)
 %}
 
 %typemap(cscode) Dali::Quaternion %{
 %}
 
 %typemap(cscode) Dali::Quaternion %{
-  public static Quaternion operator+(Quaternion arg1, Quaternion arg2) {
+  public static Rotation operator+(Rotation arg1, Rotation arg2) {
     return arg1.Add(arg2);
   }
 
     return arg1.Add(arg2);
   }
 
-  public static Quaternion operator-(Quaternion arg1, Quaternion arg2) {
+  public static Rotation operator-(Rotation arg1, Rotation arg2) {
     return arg1.Subtract(arg2);
   }
 
     return arg1.Subtract(arg2);
   }
 
-  public static Quaternion operator-(Quaternion arg1) {
+  public static Rotation operator-(Rotation arg1) {
     return arg1.Subtract();
   }
 
     return arg1.Subtract();
   }
 
-  public static Quaternion operator*(Quaternion arg1, Quaternion arg2) {
+  public static Rotation operator*(Rotation arg1, Rotation arg2) {
     return arg1.Multiply(arg2);
   }
 
     return arg1.Multiply(arg2);
   }
 
-  public static Vector3 operator*(Quaternion arg1, Vector3 arg2) {
+  public static Vector3 operator*(Rotation arg1, Vector3 arg2) {
     return arg1.Multiply(arg2);
   }
 
     return arg1.Multiply(arg2);
   }
 
-  public static Quaternion operator*(Quaternion arg1, float arg2) {
+  public static Rotation operator*(Rotation arg1, float arg2) {
     return arg1.Multiply(arg2);
   }
 
     return arg1.Multiply(arg2);
   }
 
-  public static Quaternion operator/(Quaternion arg1, Quaternion arg2) {
+  public static Rotation operator/(Rotation arg1, Rotation arg2) {
     return arg1.Divide(arg2);
   }
 
     return arg1.Divide(arg2);
   }
 
-  public static Quaternion operator/(Quaternion arg1, float arg2) {
+  public static Rotation operator/(Rotation arg1, float arg2) {
     return arg1.Divide(arg2);
   }
 %}
     return arg1.Divide(arg2);
   }
 %}
index aeb8558..4473091 100755 (executable)
@@ -283,6 +283,7 @@ using namespace Dali::Toolkit;
 %include events/videoview-event.i
 
 %include alphafunction.i
 %include events/videoview-event.i
 
 %include alphafunction.i
+%include rotation.i
 %include name-changed.i
 %include property-value.i
 %include dali-operator.i
 %include name-changed.i
 %include property-value.i
 %include dali-operator.i
diff --git a/plugins/dali-swig/SWIG/rotation.i b/plugins/dali-swig/SWIG/rotation.i
new file mode 100755 (executable)
index 0000000..f243b99
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+%rename(Rotation) Dali::Quaternion;
+%rename(GetAxisAngle) Dali::Quaternion::ToAxisAngle;
+
+%ignore Dali::Quaternion::Quaternion( Radian pitch, Radian yaw, Radian roll );
+%ignore Dali::Quaternion::Quaternion(const Matrix& matrix);
+%ignore Dali::Quaternion::Quaternion( const Vector4& vector );
+%ignore Dali::Quaternion::Quaternion( const Vector3& v0, const Vector3& v1 );
+%ignore Dali::Quaternion::Quaternion( const Vector3& xAxis, const Vector3& yAxis, const Vector3& zAxis );
+%ignore Dali::Quaternion::Quaternion( float cosThetaBy2, float iBySineTheta, float jBySineTheta, float kBySineTheta );
+%ignore Dali::Quaternion::SetEuler( Radian pitch, Radian yaw, Radian roll );
+%ignore Dali::Quaternion::EulerAngles() const;
+%ignore Dali::Quaternion::AsVector() const;
+%ignore Dali::Quaternion::Rotate( const Vector4& vector ) const;
+%ignore Dali::Quaternion::Rotate( const Vector3& vector ) const;
+%ignore Dali::Quaternion::mVector;
+
+%csmethodmodifiers Dali::Quaternion::operator+ "private";
+%csmethodmodifiers Dali::Quaternion::operator- "private";
+%csmethodmodifiers Dali::Quaternion::operator* "private";
+%csmethodmodifiers Dali::Quaternion::operator/ "private";
+%csmethodmodifiers Dali::Quaternion::operator+= "private";
+%csmethodmodifiers Dali::Quaternion::operator-= "private";
+%csmethodmodifiers Dali::Quaternion::operator*= "private";
+%csmethodmodifiers Dali::Quaternion::operator/= "private";
+%csmethodmodifiers Dali::Quaternion::operator== "private";
+%csmethodmodifiers Dali::Quaternion::operator!= "private";
index 314c9a8..a392996 100755 (executable)
@@ -81,14 +81,14 @@ namespace MyCSharpExample
           StartTime = 0,
           EndTime = 500,
           TargetProperty = "Orientation",
           StartTime = 0,
           EndTime = 500,
           TargetProperty = "Orientation",
-          Destination = new Quaternion( new Radian( new Degree( 180.0f ) ), Vect3.Xaxis)
+          Destination = new Rotation( new Radian( new Degree( 180.0f ) ), Vect3.Xaxis)
         };
         _animation.AnimateTo(_text);
 
         _animation.StartTime = 500;
         _animation.EndTime = 1000;
         _animation.TargetProperty = "Orientation";
         };
         _animation.AnimateTo(_text);
 
         _animation.StartTime = 500;
         _animation.EndTime = 1000;
         _animation.TargetProperty = "Orientation";
-        _animation.Destination = new Quaternion( new Radian( new Degree( 0.0f ) ), Vect3.Xaxis );
+        _animation.Destination = new Rotation( new Radian( new Degree( 0.0f ) ), Vect3.Xaxis );
         _animation.AnimateTo(_text);
 
         _animation.StartTime = 1000;
         _animation.AnimateTo(_text);
 
         _animation.StartTime = 1000;
index 834c4bd..cc42168 100755 (executable)
@@ -115,7 +115,7 @@ namespace MyCSharpExample
       _scrollBar.AnchorPoint = NDalic.AnchorPointTopLeft;
       _scrollBar.SetResizePolicy(ResizePolicyType.FIT_TO_CHILDREN, DimensionType.WIDTH);
       _scrollBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
       _scrollBar.AnchorPoint = NDalic.AnchorPointTopLeft;
       _scrollBar.SetResizePolicy(ResizePolicyType.FIT_TO_CHILDREN, DimensionType.WIDTH);
       _scrollBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
-      _scrollBar.Orientation = new Quaternion( new Radian( new Degree( 270.0f ) ), Vector3.ZAXIS );
+      _scrollBar.Orientation = new Rotation( new Radian( new Degree( 270.0f ) ), Vector3.ZAXIS );
       _scrollBar.SetScrollDirection(ScrollBar.Direction.Horizontal);
       _scrollView.Add(_scrollBar);
 
       _scrollBar.SetScrollDirection(ScrollBar.Direction.Horizontal);
       _scrollView.Add(_scrollBar);
 
@@ -165,8 +165,8 @@ namespace MyCSharpExample
 
         _animation = new Animation(1.0f); // 1 second of duration
 
 
         _animation = new Animation(1.0f); // 1 second of duration
 
-        _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.Linear), new TimePeriod(0.0f, 0.5f));
-        _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Quaternion( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.Linear), new TimePeriod(0.5f, 0.5f));
+        _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Rotation( new Radian( new Degree( 180.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.Linear), new TimePeriod(0.0f, 0.5f));
+        _animation.AnimateTo(new Property(_text, Actor.Property.ORIENTATION), new Property.Value(new Rotation( new Radian( new Degree( 0.0f ) ), Vector3.XAXIS )), new AlphaFunction(AlphaFunction.BuiltinFunction.Linear), new TimePeriod(0.5f, 0.5f));
 
         // Connect the signal callback for animaiton finished signal
         _animation.Finished += AnimationFinished;
 
         // Connect the signal callback for animaiton finished signal
         _animation.Finished += AnimationFinished;
index 9d6ea2d..78cb1f2 100755 (executable)
@@ -20,8 +20,8 @@ $typeTable =  [
         ["VECTOR4",     "Vector4",          "",     "Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);"],
         ["MATRIX3",     "Matrix3",          "",     "Matrix3 temp = new Matrix3();"],
         ["MATRIX",      "Matrix",           "",     "Matrix temp = new Matrix();"  ],
         ["VECTOR4",     "Vector4",          "",     "Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);"],
         ["MATRIX3",     "Matrix3",          "",     "Matrix3 temp = new Matrix3();"],
         ["MATRIX",      "Matrix",           "",     "Matrix temp = new Matrix();"  ],
-        ["RECTANGLE",   "Rectangle",      "",     "Rectangle temp = new Rectangle(0,0,0,0);"],
-        ["ROTATION",    "Quaternion",       "",    "Quaternion temp = new Quaternion();"],
+        ["RECTANGLE",   "Rectangle",        "",     "Rectangle temp = new Rectangle(0,0,0,0);"],
+        ["ROTATION",    "Rotation",       "",     "Rotation temp = new Rotation();"],
         ["STRING",      "string",           "out",  "string temp;"],
         ["ARRAY",       "Dali.Property.Array",   "",     "Dali.Property.Array temp = new Dali.Property.Array();"],
         ["MAP",         "Dali.Property.Map",     "",     "Dali.Property.Map temp = new Dali.Property.Map();"],
         ["STRING",      "string",           "out",  "string temp;"],
         ["ARRAY",       "Dali.Property.Array",   "",     "Dali.Property.Array temp = new Dali.Property.Array();"],
         ["MAP",         "Dali.Property.Map",     "",     "Dali.Property.Map temp = new Dali.Property.Map();"],