DALI_TEST_EQUALS(actorQuaternion, Quaternion(), TEST_LOCATION);
END_TEST;
-}
\ No newline at end of file
+}
+
+int UtcDaliActorIsHittable(void)
+{
+ TestApplication application;
+
+ Actor parent = Actor::New();
+ Vector4 parentColor(1.0f, 0.5f, 0.0f, 0.8f);
+ parent.SetProperty(Actor::Property::COLOR, parentColor);
+ application.GetScene().Add(parent);
+
+ Actor actor = Actor::New();
+ Vector4 childColor(0.5f, 0.6f, 0.5f, 1.0f);
+ actor.SetProperty(Actor::Property::COLOR, childColor);
+ parent.Add(actor);
+
+ actor.SetProperty(Actor::Property::SENSITIVE, true);
+ actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, true);
+ actor.SetProperty(Actor::Property::VISIBLE, true);
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_CHECK(DevelActor::IsHittable(actor) == true);
+
+ actor.SetProperty(Actor::Property::SENSITIVE, false);
+ DALI_TEST_CHECK(DevelActor::IsHittable(actor) == false);
+ actor.SetProperty(Actor::Property::SENSITIVE, true);
+
+ actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, false);
+ DALI_TEST_CHECK(DevelActor::IsHittable(actor) == false);
+ actor.SetProperty(DevelActor::Property::USER_INTERACTION_ENABLED, true);
+
+ actor.SetProperty(Actor::Property::VISIBLE, false);
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_CHECK(DevelActor::IsHittable(actor) == false);
+
+ END_TEST;
+}
+
+int UtcDaliActorGetTouchRequired(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_CHECK(DevelActor::GetTouchRequired(actor) == false);
+
+ actor.TouchedSignal().Connect(TestTouchCallback);
+ DALI_TEST_CHECK(DevelActor::GetTouchRequired(actor) == true);
+
+ END_TEST;
+}
GetImplementation(actor).SetOrientation(orientation);
}
+bool IsHittable(Actor actor)
+{
+ return GetImplementation(actor).IsHittable();
+}
+
+bool GetTouchRequired(Actor actor)
+{
+ return GetImplementation(actor).GetTouchRequired();
+}
+
} // namespace DevelActor
} // namespace Dali
*/
DALI_CORE_API void LookAt(Actor actor, Vector3 target, Vector3 up = Vector3::YAXIS, Vector3 localForward = Vector3::ZAXIS, Vector3 localUp = Vector3::YAXIS);
+/**
+ * Query whether the actor is actually hittable. This method checks whether the actor is
+ * sensitive, has the visibility flag set to true and is not fully transparent.
+ *
+ * @param[in] actor The actor for whether is hittable or not
+ * @return true, if it can be hit, false otherwise.
+ */
+DALI_CORE_API bool IsHittable(Actor actor);
+
+/**
+ * Query whether the application or derived actor type requires touch events.
+ *
+ * @param[in] actor The actor for whether is required for touch event or not.
+ * @return True if touch events are required.
+ */
+DALI_CORE_API bool GetTouchRequired(Actor actor);
+
} // namespace DevelActor
} // namespace Dali
}
/**
+ * @copydoc Dali::DevelActor::IsHittable()
+ */
+ bool IsHittable() const
+ {
+ return (IsUserInteractionEnabled()) && IsSensitive() && IsVisible() && (GetCurrentWorldColor().a > FULLY_TRANSPARENT) && IsNodeConnected();
+ }
+
+ /**
+ * @copydoc Dali::DevelActor::GetTouchRequired()
+ */
+ bool GetTouchRequired() const
+ {
+ return !mTouchedSignal.Empty();
+ }
+
+ /**
* Set whether this view can focus by touch.
* @param[in] focusable focuable by touch.
*/
}
/**
- * Query whether the application or derived actor type requires touch events.
- * @return True if touch events are required.
- */
- bool GetTouchRequired() const
- {
- return !mTouchedSignal.Empty();
- }
-
- /**
* Query whether the application or derived actor type requires hover events.
* @return True if hover events are required.
*/
}
/**
- * Query whether the actor is actually hittable. This method checks whether the actor is
- * sensitive, has the visibility flag set to true and is not fully transparent.
- * @return true, if it can be hit, false otherwise.
- */
- bool IsHittable() const
- {
- return (IsUserInteractionEnabled()) && IsSensitive() && IsVisible() && (GetCurrentWorldColor().a > FULLY_TRANSPARENT) && IsNodeConnected();
- }
-
- /**
* Query whether the actor captures all touch after it starts even if touch leaves its boundary.
* @return true, if it captures all touch after start
*/