[Tizen] Property Notify for orientation changes
authordongsug.song <dongsug.song@samsung.com>
Mon, 6 Nov 2023 09:50:28 +0000 (18:50 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Mon, 6 Nov 2023 09:50:36 +0000 (18:50 +0900)
This reverts commit f2bac82fe23a1ec774390e1221276aa954d08e3c.

Change-Id: I22e212b9ed8883a59109bf03cf6297f88bf2aa08

dali/internal/update/common/property-condition-step-functions.cpp
dali/internal/update/common/property-condition-step-functions.h
dali/internal/update/common/property-condition-variable-step-functions.cpp
dali/internal/update/common/property-condition-variable-step-functions.h
dali/public-api/object/property-conditions.h

index 9076a8a..8674b0b 100644 (file)
@@ -20,6 +20,7 @@
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/vector4.h>
+#include <dali/public-api/math/quaternion.h>
 #include <dali/public-api/object/property-input.h>
 
 namespace Dali
@@ -70,6 +71,11 @@ ConditionFunction Step::GetFunction(Property::Type valueType)
       function = EvalVector4;
       break;
     }
+    case Property::ROTATION:
+    {
+      function = EvalQuaternion;
+      break;
+    }
     default:
     {
       function = EvalDefault;
@@ -161,6 +167,15 @@ bool Step::EvalVector4(const Dali::PropertyInput& value, PropertyNotification::R
   return Evaluate(propertyValue, arg);
 }
 
+bool Step::EvalQuaternion(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg)
+{
+  Quaternion propertyValue = value.GetQuaternion();
+  // TODO : Make some meaningfule calculation here
+  Vector4 v = propertyValue.EulerAngles();
+  const float checkValue = v.LengthSquared();
+  return Evaluate(checkValue, arg);
+}
+
 bool Step::EvalDefault(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg)
 {
   return false;
index 57fe42c..7f5dc5d 100644 (file)
@@ -39,6 +39,7 @@ namespace SceneGraph
  * Vector2    => 2 dimensional length of vector has stepped arg1 amount from arg0.
  * Vector3    => 3 dimensional length of vector has stepped arg1 amount from arg0.
  * Vector4    => 4 dimensional length of vector has stepped arg1 amount from arg0.
+ * Quaternion => sum of rotation angle and axis changes has stepped arg1 amount from arg0
  * Default    => return false.
  */
 class Step
@@ -113,6 +114,14 @@ private:
   static bool EvalVector4(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
 
   /**
+   * Checks if Quaternion is Outside
+   * @param[in] value The value being examined.
+   * @param[in] arg The supplied arguments for the condition.
+   * @return Condition result (true if condition met, false if not)
+   */
+  static bool EvalQuaternion(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
+
+  /**
    * Default check for other types.
    * @param[in] value The value being examined.
    * @param[in] arg The supplied arguments for the condition.
index e194329..8f61c7a 100644 (file)
@@ -20,6 +20,7 @@
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/vector4.h>
+#include <dali/public-api/math/quaternion.h>
 #include <dali/public-api/object/property-input.h>
 
 namespace Dali
@@ -67,6 +68,11 @@ ConditionFunction VariableStep::GetFunction(Property::Type valueType)
       function = EvalVector4;
       break;
     }
+    case Property::ROTATION:
+    {
+      function = EvalQuaternion;
+      break;
+    }
     default:
     {
       function = EvalDefault;
@@ -172,6 +178,15 @@ bool VariableStep::EvalVector4(const Dali::PropertyInput& value, PropertyNotific
   return Evaluate(propertyValue, arg);
 }
 
+bool VariableStep::EvalQuaternion(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg)
+{
+  Quaternion propertyValue = value.GetQuaternion();
+  // TODO : Make some meaningfule calculation here
+  Vector4 v = propertyValue.EulerAngles();
+  const float checkValue = v.LengthSquared();
+  return Evaluate(checkValue, arg);
+}
+
 bool VariableStep::EvalDefault(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg)
 {
   return false;
index 16c7640..d404e1b 100644 (file)
@@ -39,6 +39,7 @@ namespace SceneGraph
  * Vector2    => 2 dimensional length of vector has stepped arg1 amount from arg0.
  * Vector3    => 3 dimensional length of vector has stepped arg1 amount from arg0.
  * Vector4    => 4 dimensional length of vector has stepped arg1 amount from arg0.
+ * Quaternion => sum of rotation angle and axis changes has stepped arg1 amount from arg0
  * Default    => return false.
  */
 class VariableStep
@@ -99,6 +100,14 @@ private:
   static bool EvalVector4(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
 
   /**
+   * Checks if Quaternion is Outside
+   * @param[in] value The value being examined.
+   * @param[in] arg The supplied arguments for the condition.
+   * @return Condition result (true if condition met, false if not)
+   */
+  static bool EvalQuaternion(const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg);
+
+  /**
    * Default check for other types.
    * @param[in] value The value being examined.
    * @param[in] arg The supplied arguments for the condition.
index a3f39e9..99ec9b7 100644 (file)
@@ -178,6 +178,7 @@ DALI_CORE_API PropertyCondition OutsideCondition(float arg0, float arg1);
  * vector2 (the 2D length)
  * vector3 (the 3D length)
  * vector4 (the 4D length)
+ * quaternion (the radian of rotation and axis)
  * @SINCE_1_0.0
  * @param[in] stepAmount The step size required to trigger condition
  * @param[in] initialValue The initial value to step from
@@ -193,6 +194,7 @@ DALI_CORE_API PropertyCondition StepCondition(float stepAmount, float initialVal
  * vector2 (the 2D length)
  * vector3 (the 3D length)
  * vector4 (the 4D length)
+ * quaternion (the radian of rotation and axis)
  * @SINCE_1_0.0
  * @param[in] steps List of values to receive notifications for as a property crosses them
  * @return A property condition function object