2 * Copyright (c) 2021 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.
19 #include <dali/internal/event/actors/actor-impl.h>
27 #include <dali/public-api/common/constants.h>
28 #include <dali/public-api/common/dali-common.h>
29 #include <dali/public-api/math/radian.h>
30 #include <dali/public-api/math/vector2.h>
31 #include <dali/public-api/math/vector3.h>
32 #include <dali/public-api/object/type-registry.h>
34 #include <dali/devel-api/actors/actor-devel.h>
35 #include <dali/devel-api/common/capabilities.h>
37 #include <dali/integration-api/debug.h>
39 #include <dali/internal/event/actors/actor-coords.h>
40 #include <dali/internal/event/actors/actor-parent.h>
41 #include <dali/internal/event/actors/actor-property-handler.h>
42 #include <dali/internal/event/actors/actor-relayouter.h>
43 #include <dali/internal/event/actors/camera-actor-impl.h>
44 #include <dali/internal/event/common/event-thread-services.h>
45 #include <dali/internal/event/common/property-helper.h>
46 #include <dali/internal/event/common/scene-impl.h>
47 #include <dali/internal/event/common/stage-impl.h>
48 #include <dali/internal/event/common/thread-local-storage.h>
49 #include <dali/internal/event/common/type-info-impl.h>
50 #include <dali/internal/event/events/actor-gesture-data.h>
51 #include <dali/internal/event/render-tasks/render-task-impl.h>
52 #include <dali/internal/event/render-tasks/render-task-list-impl.h>
53 #include <dali/internal/event/rendering/renderer-impl.h>
54 #include <dali/internal/event/size-negotiation/relayout-controller-impl.h>
55 #include <dali/internal/update/manager/update-manager.h>
56 #include <dali/internal/update/nodes/node-messages.h>
58 using Dali::Internal::SceneGraph::AnimatableProperty;
59 using Dali::Internal::SceneGraph::Node;
60 using Dali::Internal::SceneGraph::PropertyBase;
62 #if defined(DEBUG_ENABLED)
63 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_DEPTH_TIMER");
70 namespace // unnamed namespace
75 * We want to discourage the use of property strings (minimize string comparisons),
76 * particularly for the default properties.
77 * Name Type writable animatable constraint-input enum for index-checking
79 DALI_PROPERTY_TABLE_BEGIN
80 DALI_PROPERTY("parentOrigin", VECTOR3, true, false, true, Dali::Actor::Property::PARENT_ORIGIN)
81 DALI_PROPERTY("parentOriginX", FLOAT, true, false, true, Dali::Actor::Property::PARENT_ORIGIN_X)
82 DALI_PROPERTY("parentOriginY", FLOAT, true, false, true, Dali::Actor::Property::PARENT_ORIGIN_Y)
83 DALI_PROPERTY("parentOriginZ", FLOAT, true, false, true, Dali::Actor::Property::PARENT_ORIGIN_Z)
84 DALI_PROPERTY("anchorPoint", VECTOR3, true, false, true, Dali::Actor::Property::ANCHOR_POINT)
85 DALI_PROPERTY("anchorPointX", FLOAT, true, false, true, Dali::Actor::Property::ANCHOR_POINT_X)
86 DALI_PROPERTY("anchorPointY", FLOAT, true, false, true, Dali::Actor::Property::ANCHOR_POINT_Y)
87 DALI_PROPERTY("anchorPointZ", FLOAT, true, false, true, Dali::Actor::Property::ANCHOR_POINT_Z)
88 DALI_PROPERTY("size", VECTOR3, true, true, true, Dali::Actor::Property::SIZE)
89 DALI_PROPERTY("sizeWidth", FLOAT, true, true, true, Dali::Actor::Property::SIZE_WIDTH)
90 DALI_PROPERTY("sizeHeight", FLOAT, true, true, true, Dali::Actor::Property::SIZE_HEIGHT)
91 DALI_PROPERTY("sizeDepth", FLOAT, true, true, true, Dali::Actor::Property::SIZE_DEPTH)
92 DALI_PROPERTY("position", VECTOR3, true, true, true, Dali::Actor::Property::POSITION)
93 DALI_PROPERTY("positionX", FLOAT, true, true, true, Dali::Actor::Property::POSITION_X)
94 DALI_PROPERTY("positionY", FLOAT, true, true, true, Dali::Actor::Property::POSITION_Y)
95 DALI_PROPERTY("positionZ", FLOAT, true, true, true, Dali::Actor::Property::POSITION_Z)
96 DALI_PROPERTY("worldPosition", VECTOR3, false, false, true, Dali::Actor::Property::WORLD_POSITION)
97 DALI_PROPERTY("worldPositionX", FLOAT, false, false, true, Dali::Actor::Property::WORLD_POSITION_X)
98 DALI_PROPERTY("worldPositionY", FLOAT, false, false, true, Dali::Actor::Property::WORLD_POSITION_Y)
99 DALI_PROPERTY("worldPositionZ", FLOAT, false, false, true, Dali::Actor::Property::WORLD_POSITION_Z)
100 DALI_PROPERTY("orientation", ROTATION, true, true, true, Dali::Actor::Property::ORIENTATION)
101 DALI_PROPERTY("worldOrientation", ROTATION, false, false, true, Dali::Actor::Property::WORLD_ORIENTATION)
102 DALI_PROPERTY("scale", VECTOR3, true, true, true, Dali::Actor::Property::SCALE)
103 DALI_PROPERTY("scaleX", FLOAT, true, true, true, Dali::Actor::Property::SCALE_X)
104 DALI_PROPERTY("scaleY", FLOAT, true, true, true, Dali::Actor::Property::SCALE_Y)
105 DALI_PROPERTY("scaleZ", FLOAT, true, true, true, Dali::Actor::Property::SCALE_Z)
106 DALI_PROPERTY("worldScale", VECTOR3, false, false, true, Dali::Actor::Property::WORLD_SCALE)
107 DALI_PROPERTY("visible", BOOLEAN, true, true, true, Dali::Actor::Property::VISIBLE)
108 DALI_PROPERTY("color", VECTOR4, true, true, true, Dali::Actor::Property::COLOR)
109 DALI_PROPERTY("colorRed", FLOAT, true, true, true, Dali::Actor::Property::COLOR_RED)
110 DALI_PROPERTY("colorGreen", FLOAT, true, true, true, Dali::Actor::Property::COLOR_GREEN)
111 DALI_PROPERTY("colorBlue", FLOAT, true, true, true, Dali::Actor::Property::COLOR_BLUE)
112 DALI_PROPERTY("colorAlpha", FLOAT, true, true, true, Dali::Actor::Property::COLOR_ALPHA)
113 DALI_PROPERTY("worldColor", VECTOR4, false, false, true, Dali::Actor::Property::WORLD_COLOR)
114 DALI_PROPERTY("worldMatrix", MATRIX, false, false, true, Dali::Actor::Property::WORLD_MATRIX)
115 DALI_PROPERTY("name", STRING, true, false, false, Dali::Actor::Property::NAME)
116 DALI_PROPERTY("sensitive", BOOLEAN, true, false, false, Dali::Actor::Property::SENSITIVE)
117 DALI_PROPERTY("leaveRequired", BOOLEAN, true, false, false, Dali::Actor::Property::LEAVE_REQUIRED)
118 DALI_PROPERTY("inheritOrientation", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_ORIENTATION)
119 DALI_PROPERTY("inheritScale", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_SCALE)
120 DALI_PROPERTY("colorMode", INTEGER, true, false, false, Dali::Actor::Property::COLOR_MODE)
121 DALI_PROPERTY("drawMode", INTEGER, true, false, false, Dali::Actor::Property::DRAW_MODE)
122 DALI_PROPERTY("sizeModeFactor", VECTOR3, true, false, false, Dali::Actor::Property::SIZE_MODE_FACTOR)
123 DALI_PROPERTY("widthResizePolicy", STRING, true, false, false, Dali::Actor::Property::WIDTH_RESIZE_POLICY)
124 DALI_PROPERTY("heightResizePolicy", STRING, true, false, false, Dali::Actor::Property::HEIGHT_RESIZE_POLICY)
125 DALI_PROPERTY("sizeScalePolicy", INTEGER, true, false, false, Dali::Actor::Property::SIZE_SCALE_POLICY)
126 DALI_PROPERTY("widthForHeight", BOOLEAN, true, false, false, Dali::Actor::Property::WIDTH_FOR_HEIGHT)
127 DALI_PROPERTY("heightForWidth", BOOLEAN, true, false, false, Dali::Actor::Property::HEIGHT_FOR_WIDTH)
128 DALI_PROPERTY("padding", VECTOR4, true, false, false, Dali::Actor::Property::PADDING)
129 DALI_PROPERTY("minimumSize", VECTOR2, true, false, false, Dali::Actor::Property::MINIMUM_SIZE)
130 DALI_PROPERTY("maximumSize", VECTOR2, true, false, false, Dali::Actor::Property::MAXIMUM_SIZE)
131 DALI_PROPERTY("inheritPosition", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_POSITION)
132 DALI_PROPERTY("clippingMode", STRING, true, false, false, Dali::Actor::Property::CLIPPING_MODE)
133 DALI_PROPERTY("layoutDirection", STRING, true, false, false, Dali::Actor::Property::LAYOUT_DIRECTION)
134 DALI_PROPERTY("inheritLayoutDirection", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION)
135 DALI_PROPERTY("opacity", FLOAT, true, true, true, Dali::Actor::Property::OPACITY)
136 DALI_PROPERTY("screenPosition", VECTOR2, false, false, false, Dali::Actor::Property::SCREEN_POSITION)
137 DALI_PROPERTY("positionUsesAnchorPoint", BOOLEAN, true, false, false, Dali::Actor::Property::POSITION_USES_ANCHOR_POINT)
138 DALI_PROPERTY("culled", BOOLEAN, false, false, true, Dali::Actor::Property::CULLED)
139 DALI_PROPERTY("id", INTEGER, false, false, false, Dali::Actor::Property::ID)
140 DALI_PROPERTY("hierarchyDepth", INTEGER, false, false, false, Dali::Actor::Property::HIERARCHY_DEPTH)
141 DALI_PROPERTY("isRoot", BOOLEAN, false, false, false, Dali::Actor::Property::IS_ROOT)
142 DALI_PROPERTY("isLayer", BOOLEAN, false, false, false, Dali::Actor::Property::IS_LAYER)
143 DALI_PROPERTY("connectedToScene", BOOLEAN, false, false, false, Dali::Actor::Property::CONNECTED_TO_SCENE)
144 DALI_PROPERTY("keyboardFocusable", BOOLEAN, true, false, false, Dali::Actor::Property::KEYBOARD_FOCUSABLE)
145 DALI_PROPERTY("siblingOrder", INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER)
146 DALI_PROPERTY("updateSizeHint", VECTOR2, true, false, false, Dali::DevelActor::Property::UPDATE_SIZE_HINT)
147 DALI_PROPERTY("captureAllTouchAfterStart", BOOLEAN, true, false, false, Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START)
148 DALI_PROPERTY("touchAreaOffset", RECTANGLE, true, false, false, Dali::DevelActor::Property::TOUCH_AREA_OFFSET)
149 DALI_PROPERTY("blendEquation", INTEGER, true, false, false, Dali::DevelActor::Property::BLEND_EQUATION)
150 DALI_PROPERTY("touchFocusable", BOOLEAN, true, false, false, Dali::DevelActor::Property::TOUCH_FOCUSABLE)
151 DALI_PROPERTY("keyboardFocusableChildren", BOOLEAN, true, false, false, Dali::DevelActor::Property::KEYBOARD_FOCUSABLE_CHILDREN)
152 DALI_PROPERTY_TABLE_END(DEFAULT_ACTOR_PROPERTY_START_INDEX, ActorDefaultProperties)
156 static constexpr std::string_view SIGNAL_HOVERED = "hovered";
157 static constexpr std::string_view SIGNAL_WHEEL_EVENT = "wheelEvent";
158 static constexpr std::string_view SIGNAL_ON_SCENE = "onScene";
159 static constexpr std::string_view SIGNAL_OFF_SCENE = "offScene";
160 static constexpr std::string_view SIGNAL_ON_RELAYOUT = "onRelayout";
161 static constexpr std::string_view SIGNAL_TOUCHED = "touched";
162 static constexpr std::string_view SIGNAL_VISIBILITY_CHANGED = "visibilityChanged";
163 static constexpr std::string_view SIGNAL_LAYOUT_DIRECTION_CHANGED = "layoutDirectionChanged";
164 static constexpr std::string_view SIGNAL_CHILD_ADDED = "childAdded";
165 static constexpr std::string_view SIGNAL_CHILD_REMOVED = "childRemoved";
169 static constexpr std::string_view ACTION_SHOW = "show";
170 static constexpr std::string_view ACTION_HIDE = "hide";
172 BaseHandle CreateActor()
174 return Dali::Actor::New();
177 TypeRegistration mType(typeid(Dali::Actor), typeid(Dali::Handle), CreateActor, ActorDefaultProperties);
179 SignalConnectorType signalConnector2(mType, std::string(SIGNAL_HOVERED), &Actor::DoConnectSignal);
180 SignalConnectorType signalConnector3(mType, std::string(SIGNAL_WHEEL_EVENT), &Actor::DoConnectSignal);
181 SignalConnectorType signalConnector4(mType, std::string(SIGNAL_ON_SCENE), &Actor::DoConnectSignal);
182 SignalConnectorType signalConnector5(mType, std::string(SIGNAL_OFF_SCENE), &Actor::DoConnectSignal);
183 SignalConnectorType signalConnector6(mType, std::string(SIGNAL_ON_RELAYOUT), &Actor::DoConnectSignal);
184 SignalConnectorType signalConnector7(mType, std::string(SIGNAL_TOUCHED), &Actor::DoConnectSignal);
185 SignalConnectorType signalConnector8(mType, std::string(SIGNAL_VISIBILITY_CHANGED), &Actor::DoConnectSignal);
186 SignalConnectorType signalConnector9(mType, std::string(SIGNAL_LAYOUT_DIRECTION_CHANGED), &Actor::DoConnectSignal);
187 SignalConnectorType signalConnector10(mType, std::string(SIGNAL_CHILD_ADDED), &Actor::DoConnectSignal);
188 SignalConnectorType signalConnector11(mType, std::string(SIGNAL_CHILD_REMOVED), &Actor::DoConnectSignal);
190 TypeAction a1(mType, std::string(ACTION_SHOW), &Actor::DoAction);
191 TypeAction a2(mType, std::string(ACTION_HIDE), &Actor::DoAction);
194 * @brief Extract a given dimension from a Vector2
196 * @param[in] values The values to extract from
197 * @param[in] dimension The dimension to extract
198 * @return Return the value for the dimension
200 constexpr float GetDimensionValue(const Vector2& values, Dimension::Type dimension)
204 case Dimension::WIDTH:
208 case Dimension::HEIGHT:
210 return values.height;
221 * @brief Extract a given dimension from a Vector3
223 * @param[in] values The values to extract from
224 * @param[in] dimension The dimension to extract
225 * @return Return the value for the dimension
227 float GetDimensionValue(const Vector3& values, Dimension::Type dimension)
229 return GetDimensionValue(values.GetVectorXY(), dimension);
232 /// Helper for emitting a signal
233 template<typename Signal, typename Event>
234 bool EmitConsumingSignal(Actor& actor, Signal& signal, const Event& event)
236 bool consumed = false;
240 Dali::Actor handle(&actor);
241 consumed = signal.Emit(handle, event);
247 /// Helper for emitting signals with multiple parameters
248 template<typename Signal, typename... Param>
249 void EmitSignal(Actor& actor, Signal& signal, Param... params)
253 Dali::Actor handle(&actor);
254 signal.Emit(handle, params...);
258 } // unnamed namespace
260 ActorPtr Actor::New()
262 // pass a reference to actor, actor does not own its node
263 ActorPtr actor(new Actor(BASIC, *CreateNode()));
265 // Second-phase construction
271 const SceneGraph::Node* Actor::CreateNode()
273 // create node. Nodes are owned by the update manager
274 SceneGraph::Node* node = SceneGraph::Node::New();
275 OwnerPointer<SceneGraph::Node> transferOwnership(node);
276 Internal::ThreadLocalStorage* tls = Internal::ThreadLocalStorage::GetInternal();
278 DALI_ASSERT_ALWAYS(tls && "ThreadLocalStorage is null");
280 AddNodeMessage(tls->GetUpdateManager(), transferOwnership);
285 void Actor::SetName(std::string_view name)
287 mName = ConstString(name);
289 // ATTENTION: string for debug purposes is not thread safe.
290 DALI_LOG_SET_OBJECT_STRING(const_cast<SceneGraph::Node*>(&GetNode()), mName.GetCString());
293 uint32_t Actor::GetId() const
295 return GetNode().GetId();
298 Dali::Layer Actor::GetLayer()
302 // Short-circuit for Layer derived actors
305 layer = Dali::Layer(static_cast<Dali::Internal::Layer*>(this)); // static cast as we trust the flag
308 // Find the immediate Layer parent
309 for(Actor* parent = GetParent(); !layer && parent != nullptr; parent = parent->GetParent())
311 if(parent->IsLayer())
313 layer = Dali::Layer(static_cast<Dali::Internal::Layer*>(parent)); // static cast as we trust the flag
320 void Actor::Unparent()
324 // Remove this actor from the parent. The remove will put a relayout request in for
325 // the parent if required
326 mParent->Remove(*this);
327 // mParent is now NULL!
331 void Actor::SetParentOrigin(const Vector3& origin)
333 // node is being used in a separate thread; queue a message to set the value & base value
334 SetParentOriginMessage(GetEventThreadServices(), GetNode(), origin);
336 // Cache for event-thread access
339 // not allocated, check if different from default
340 if(ParentOrigin::DEFAULT != origin)
342 mParentOrigin = new Vector3(origin);
347 // check if different from current costs more than just set
348 *mParentOrigin = origin;
352 const Vector3& Actor::GetCurrentParentOrigin() const
354 // Cached for event-thread access
355 return (mParentOrigin) ? *mParentOrigin : ParentOrigin::DEFAULT;
358 void Actor::SetAnchorPoint(const Vector3& anchor)
360 // node is being used in a separate thread; queue a message to set the value & base value
361 SetAnchorPointMessage(GetEventThreadServices(), GetNode(), anchor);
363 // Cache for event-thread access
366 // not allocated, check if different from default
367 if(AnchorPoint::DEFAULT != anchor)
369 mAnchorPoint = new Vector3(anchor);
374 // check if different from current costs more than just set
375 *mAnchorPoint = anchor;
379 const Vector3& Actor::GetCurrentAnchorPoint() const
381 // Cached for event-thread access
382 return (mAnchorPoint) ? *mAnchorPoint : AnchorPoint::DEFAULT;
385 void Actor::SetPosition(float x, float y)
387 SetPosition(Vector3(x, y, 0.0f));
390 void Actor::SetPosition(float x, float y, float z)
392 SetPosition(Vector3(x, y, z));
395 void Actor::SetPosition(const Vector3& position)
397 mTargetPosition = position;
399 // node is being used in a separate thread; queue a message to set the value & base value
400 SceneGraph::NodeTransformPropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, position);
403 void Actor::SetX(float x)
405 mTargetPosition.x = x;
407 // node is being used in a separate thread; queue a message to set the value & base value
408 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, x);
411 void Actor::SetY(float y)
413 mTargetPosition.y = y;
415 // node is being used in a separate thread; queue a message to set the value & base value
416 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, y);
419 void Actor::SetZ(float z)
421 mTargetPosition.z = z;
423 // node is being used in a separate thread; queue a message to set the value & base value
424 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, z);
427 void Actor::TranslateBy(const Vector3& distance)
429 mTargetPosition += distance;
431 // node is being used in a separate thread; queue a message to set the value & base value
432 SceneGraph::NodeTransformPropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mPosition, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeRelative, distance);
435 const Vector3& Actor::GetCurrentPosition() const
437 // node is being used in a separate thread; copy the value from the previous update
438 return GetNode().GetPosition(GetEventThreadServices().GetEventBufferIndex());
441 const Vector3& Actor::GetCurrentWorldPosition() const
443 // node is being used in a separate thread; copy the value from the previous update
444 return GetNode().GetWorldPosition(GetEventThreadServices().GetEventBufferIndex());
447 const Vector2 Actor::GetCurrentScreenPosition() const
449 if(mScene && OnScene())
451 Vector3 worldPosition = GetNode().GetWorldPosition(GetEventThreadServices().GetEventBufferIndex());
452 Vector3 cameraPosition = mScene->GetDefaultCameraActor().GetNode().GetWorldPosition(GetEventThreadServices().GetEventBufferIndex());
453 worldPosition -= cameraPosition;
455 Vector3 actorSize = GetCurrentSize() * GetCurrentWorldScale();
456 Vector2 halfSceneSize(mScene->GetSize() * 0.5f); // World position origin is center of scene
457 Vector3 halfActorSize(actorSize * 0.5f);
458 Vector3 anchorPointOffSet = halfActorSize - actorSize * (mPositionUsesAnchorPoint ? GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT);
460 return Vector2(halfSceneSize.width + worldPosition.x - anchorPointOffSet.x,
461 halfSceneSize.height + worldPosition.y - anchorPointOffSet.y);
464 return Vector2::ZERO;
467 void Actor::SetInheritPosition(bool inherit)
469 if(mInheritPosition != inherit)
471 // non animatable so keep local copy
472 mInheritPosition = inherit;
473 SetInheritPositionMessage(GetEventThreadServices(), GetNode(), inherit);
477 void Actor::SetOrientation(const Radian& angle, const Vector3& axis)
479 Vector3 normalizedAxis(axis.x, axis.y, axis.z);
480 normalizedAxis.Normalize();
482 Quaternion orientation(angle, normalizedAxis);
484 SetOrientation(orientation);
487 void Actor::SetOrientation(const Quaternion& orientation)
489 mTargetOrientation = orientation;
491 // node is being used in a separate thread; queue a message to set the value & base value
492 SceneGraph::NodeTransformPropertyMessage<Quaternion>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mOrientation, &SceneGraph::TransformManagerPropertyHandler<Quaternion>::Bake, orientation);
495 void Actor::RotateBy(const Radian& angle, const Vector3& axis)
497 RotateBy(Quaternion(angle, axis));
500 void Actor::RotateBy(const Quaternion& relativeRotation)
502 mTargetOrientation *= Quaternion(relativeRotation);
504 // node is being used in a separate thread; queue a message to set the value & base value
505 SceneGraph::NodeTransformPropertyMessage<Quaternion>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mOrientation, &SceneGraph::TransformManagerPropertyHandler<Quaternion>::BakeRelative, relativeRotation);
508 const Quaternion& Actor::GetCurrentOrientation() const
510 // node is being used in a separate thread; copy the value from the previous update
511 return GetNode().GetOrientation(GetEventThreadServices().GetEventBufferIndex());
514 const Quaternion& Actor::GetCurrentWorldOrientation() const
516 // node is being used in a separate thread; copy the value from the previous update
517 return GetNode().GetWorldOrientation(GetEventThreadServices().GetEventBufferIndex());
520 void Actor::SetScale(float scale)
522 SetScale(Vector3(scale, scale, scale));
525 void Actor::SetScale(float x, float y, float z)
527 SetScale(Vector3(x, y, z));
530 void Actor::SetScale(const Vector3& scale)
532 mTargetScale = scale;
534 // node is being used in a separate thread; queue a message to set the value & base value
535 SceneGraph::NodeTransformPropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, scale);
538 void Actor::SetScaleX(float x)
542 // node is being used in a separate thread; queue a message to set the value & base value
543 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, x);
546 void Actor::SetScaleY(float y)
550 // node is being used in a separate thread; queue a message to set the value & base value
551 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, y);
554 void Actor::SetScaleZ(float z)
558 // node is being used in a separate thread; queue a message to set the value & base value
559 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, z);
562 void Actor::ScaleBy(const Vector3& relativeScale)
564 mTargetScale *= relativeScale;
566 // node is being used in a separate thread; queue a message to set the value & base value
567 SceneGraph::NodeTransformPropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mScale, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeRelativeMultiply, relativeScale);
570 const Vector3& Actor::GetCurrentScale() const
572 // node is being used in a separate thread; copy the value from the previous update
573 return GetNode().GetScale(GetEventThreadServices().GetEventBufferIndex());
576 const Vector3& Actor::GetCurrentWorldScale() const
578 // node is being used in a separate thread; copy the value from the previous update
579 return GetNode().GetWorldScale(GetEventThreadServices().GetEventBufferIndex());
582 void Actor::SetInheritScale(bool inherit)
584 if(mInheritScale != inherit)
586 // non animatable so keep local copy
587 mInheritScale = inherit;
588 // node is being used in a separate thread; queue a message to set the value
589 SetInheritScaleMessage(GetEventThreadServices(), GetNode(), inherit);
593 Matrix Actor::GetCurrentWorldMatrix() const
595 return GetNode().GetWorldMatrix(0);
598 void Actor::SetVisible(bool visible)
600 SetVisibleInternal(visible, SendMessage::TRUE);
603 bool Actor::IsVisible() const
605 // node is being used in a separate thread; copy the value from the previous update
606 return GetNode().IsVisible(GetEventThreadServices().GetEventBufferIndex());
609 void Actor::SetOpacity(float opacity)
611 mTargetColor.a = opacity;
613 // node is being used in a separate thread; queue a message to set the value & base value
614 SceneGraph::NodePropertyComponentMessage<Vector4>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeW, opacity);
616 RequestRenderingMessage(GetEventThreadServices().GetUpdateManager());
619 float Actor::GetCurrentOpacity() const
621 // node is being used in a separate thread; copy the value from the previous update
622 return GetNode().GetOpacity(GetEventThreadServices().GetEventBufferIndex());
625 const Vector4& Actor::GetCurrentWorldColor() const
627 return GetNode().GetWorldColor(GetEventThreadServices().GetEventBufferIndex());
630 void Actor::SetColor(const Vector4& color)
632 mTargetColor = color;
634 // node is being used in a separate thread; queue a message to set the value & base value
635 SceneGraph::NodePropertyMessage<Vector4>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::Bake, color);
637 RequestRenderingMessage(GetEventThreadServices().GetUpdateManager());
640 void Actor::SetColorRed(float red)
642 mTargetColor.r = red;
644 // node is being used in a separate thread; queue a message to set the value & base value
645 SceneGraph::NodePropertyComponentMessage<Vector4>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeX, red);
647 RequestRenderingMessage(GetEventThreadServices().GetUpdateManager());
650 void Actor::SetColorGreen(float green)
652 mTargetColor.g = green;
654 // node is being used in a separate thread; queue a message to set the value & base value
655 SceneGraph::NodePropertyComponentMessage<Vector4>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeY, green);
657 RequestRenderingMessage(GetEventThreadServices().GetUpdateManager());
660 void Actor::SetColorBlue(float blue)
662 mTargetColor.b = blue;
664 // node is being used in a separate thread; queue a message to set the value & base value
665 SceneGraph::NodePropertyComponentMessage<Vector4>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mColor, &AnimatableProperty<Vector4>::BakeZ, blue);
667 RequestRenderingMessage(GetEventThreadServices().GetUpdateManager());
670 const Vector4& Actor::GetCurrentColor() const
672 // node is being used in a separate thread; copy the value from the previous update
673 return GetNode().GetColor(GetEventThreadServices().GetEventBufferIndex());
676 void Actor::SetInheritOrientation(bool inherit)
678 if(mInheritOrientation != inherit)
680 // non animatable so keep local copy
681 mInheritOrientation = inherit;
682 // node is being used in a separate thread; queue a message to set the value
683 SetInheritOrientationMessage(GetEventThreadServices(), GetNode(), inherit);
687 void Actor::SetSizeModeFactor(const Vector3& factor)
691 mRelayoutData->sizeModeFactor = factor;
694 const Vector3& Actor::GetSizeModeFactor() const
698 return mRelayoutData->sizeModeFactor;
701 return Relayouter::DEFAULT_SIZE_MODE_FACTOR;
704 void Actor::SetColorMode(ColorMode colorMode)
706 // non animatable so keep local copy
707 mColorMode = colorMode;
708 // node is being used in a separate thread; queue a message to set the value
709 SetColorModeMessage(GetEventThreadServices(), GetNode(), colorMode);
712 void Actor::SetSize(float width, float height)
714 SetSize(Vector2(width, height));
717 void Actor::SetSize(float width, float height, float depth)
719 SetSize(Vector3(width, height, depth));
722 void Actor::SetSize(const Vector2& size)
724 SetSize(Vector3(size.width, size.height, 0.f));
727 void Actor::SetSizeInternal(const Vector2& size)
729 SetSizeInternal(Vector3(size.width, size.height, 0.f));
732 void Actor::SetSize(const Vector3& size)
734 if(IsRelayoutEnabled() && !mRelayoutData->insideRelayout)
736 // TODO we cannot just ignore the given Z but that means rewrite the size negotiation!!
737 SetPreferredSize(size.GetVectorXY());
741 SetSizeInternal(size);
745 void Actor::SetSizeInternal(const Vector3& size)
747 // dont allow recursive loop
748 DALI_ASSERT_ALWAYS(!mInsideOnSizeSet && "Cannot call SetSize from OnSizeSet");
749 // check that we have a node AND the new size width, height or depth is at least a little bit different from the old one
750 Vector3 currentSize = GetCurrentSize();
752 if((fabsf(mTargetSize.width - size.width) > Math::MACHINE_EPSILON_1) ||
753 (fabsf(mTargetSize.height - size.height) > Math::MACHINE_EPSILON_1) ||
754 (fabsf(mTargetSize.depth - size.depth) > Math::MACHINE_EPSILON_1) ||
755 (fabsf(mTargetSize.width - currentSize.width) > Math::MACHINE_EPSILON_1) ||
756 (fabsf(mTargetSize.height - currentSize.height) > Math::MACHINE_EPSILON_1) ||
757 (fabsf(mTargetSize.depth - currentSize.depth) > Math::MACHINE_EPSILON_1))
761 // node is being used in a separate thread; queue a message to set the value & base value
762 SceneGraph::NodeTransformPropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::Bake, mTargetSize);
764 // Notification for derived classes
765 mInsideOnSizeSet = true;
766 OnSizeSet(mTargetSize);
767 mInsideOnSizeSet = false;
769 // Raise a relayout request if the flag is not locked
770 if(mRelayoutData && !mRelayoutData->insideRelayout)
777 void Actor::SetWidth(float width)
779 if(IsRelayoutEnabled() && !mRelayoutData->insideRelayout)
781 SetResizePolicy(ResizePolicy::FIXED, Dimension::WIDTH);
782 mRelayoutData->preferredSize.width = width;
786 mTargetSize.width = width;
788 // node is being used in a separate thread; queue a message to set the value & base value
789 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeX, width);
792 mUseAnimatedSize &= ~AnimatedSizeFlag::WIDTH;
797 void Actor::SetHeight(float height)
799 if(IsRelayoutEnabled() && !mRelayoutData->insideRelayout)
801 SetResizePolicy(ResizePolicy::FIXED, Dimension::HEIGHT);
802 mRelayoutData->preferredSize.height = height;
806 mTargetSize.height = height;
808 // node is being used in a separate thread; queue a message to set the value & base value
809 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeY, height);
812 mUseAnimatedSize &= ~AnimatedSizeFlag::HEIGHT;
817 void Actor::SetDepth(float depth)
819 mTargetSize.depth = depth;
821 mUseAnimatedSize &= ~AnimatedSizeFlag::DEPTH;
823 // node is being used in a separate thread; queue a message to set the value & base value
824 SceneGraph::NodeTransformComponentMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mSize, &SceneGraph::TransformManagerPropertyHandler<Vector3>::BakeZ, depth);
827 Vector3 Actor::GetTargetSize() const
829 Vector3 size = mTargetSize;
831 if(mUseAnimatedSize & AnimatedSizeFlag::WIDTH)
833 // Should return animated size if size is animated
834 size.width = mAnimatedSize.width;
838 // Should return preferred size if size is fixed as set by SetSize
839 if(GetResizePolicy(Dimension::WIDTH) == ResizePolicy::FIXED)
841 size.width = GetPreferredSize().width;
845 if(mUseAnimatedSize & AnimatedSizeFlag::HEIGHT)
847 size.height = mAnimatedSize.height;
851 if(GetResizePolicy(Dimension::HEIGHT) == ResizePolicy::FIXED)
853 size.height = GetPreferredSize().height;
857 if(mUseAnimatedSize & AnimatedSizeFlag::DEPTH)
859 size.depth = mAnimatedSize.depth;
865 const Vector3& Actor::GetCurrentSize() const
867 // node is being used in a separate thread; copy the value from the previous update
868 return GetNode().GetSize(GetEventThreadServices().GetEventBufferIndex());
871 Vector3 Actor::GetNaturalSize() const
873 // It is up to deriving classes to return the appropriate natural size
874 return Vector3(0.0f, 0.0f, 0.0f);
877 void Actor::SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension)
879 EnsureRelayouter().SetResizePolicy(policy, dimension, mTargetSize);
881 OnSetResizePolicy(policy, dimension);
883 // Trigger relayout on this control
887 ResizePolicy::Type Actor::GetResizePolicy(Dimension::Type dimension) const
891 return mRelayoutData->GetResizePolicy(dimension);
894 return ResizePolicy::DEFAULT;
897 void Actor::SetSizeScalePolicy(SizeScalePolicy::Type policy)
901 mRelayoutData->sizeSetPolicy = policy;
903 // Trigger relayout on this control
907 SizeScalePolicy::Type Actor::GetSizeScalePolicy() const
911 return mRelayoutData->sizeSetPolicy;
914 return Relayouter::DEFAULT_SIZE_SCALE_POLICY;
917 void Actor::SetDimensionDependency(Dimension::Type dimension, Dimension::Type dependency)
919 EnsureRelayouter().SetDimensionDependency(dimension, dependency);
922 Dimension::Type Actor::GetDimensionDependency(Dimension::Type dimension) const
926 return mRelayoutData->GetDimensionDependency(dimension);
929 return Dimension::ALL_DIMENSIONS; // Default
932 void Actor::SetRelayoutEnabled(bool relayoutEnabled)
934 // If relayout data has not been allocated yet and the client is requesting
935 // to disable it, do nothing
936 if(mRelayoutData || relayoutEnabled)
940 DALI_ASSERT_DEBUG(mRelayoutData && "mRelayoutData not created");
942 mRelayoutData->relayoutEnabled = relayoutEnabled;
946 bool Actor::IsRelayoutEnabled() const
948 // Assume that if relayout data has not been allocated yet then
949 // relayout is disabled
950 return mRelayoutData && mRelayoutData->relayoutEnabled;
953 void Actor::SetLayoutDirty(bool dirty, Dimension::Type dimension)
955 EnsureRelayouter().SetLayoutDirty(dirty, dimension);
958 bool Actor::IsLayoutDirty(Dimension::Type dimension) const
960 return mRelayoutData && mRelayoutData->IsLayoutDirty(dimension);
963 bool Actor::RelayoutPossible(Dimension::Type dimension) const
965 return mRelayoutData && mRelayoutData->relayoutEnabled && !IsLayoutDirty(dimension);
968 bool Actor::RelayoutRequired(Dimension::Type dimension) const
970 return mRelayoutData && mRelayoutData->relayoutEnabled && IsLayoutDirty(dimension);
973 uint32_t Actor::AddRenderer(Renderer& renderer)
977 mRenderers = new RendererContainer(GetEventThreadServices());
979 return mRenderers->Add(GetNode(), renderer, mIsBlendEquationSet, mBlendEquation);
982 uint32_t Actor::GetRendererCount() const
984 return mRenderers ? mRenderers->GetCount() : 0u;
987 RendererPtr Actor::GetRendererAt(uint32_t index)
989 return mRenderers ? mRenderers->GetRendererAt(index) : nullptr;
992 void Actor::RemoveRenderer(Renderer& renderer)
996 mRenderers->Remove(GetNode(), renderer);
1000 void Actor::RemoveRenderer(uint32_t index)
1004 mRenderers->Remove(GetNode(), index);
1008 void Actor::SetBlendEquation(DevelBlendEquation::Type blendEquation)
1010 if(Dali::Capabilities::IsBlendEquationSupported(blendEquation))
1012 if(mBlendEquation != blendEquation)
1014 mBlendEquation = blendEquation;
1017 mRenderers->SetBlending(blendEquation);
1020 mIsBlendEquationSet = true;
1024 DALI_LOG_ERROR("Invalid blend equation is entered.\n");
1028 DevelBlendEquation::Type Actor::GetBlendEquation() const
1030 return mBlendEquation;
1033 void Actor::SetTransparent(bool transparent)
1035 SetTransparentMessage(GetEventThreadServices(), GetNode(), transparent);
1038 bool Actor::IsTransparent() const
1040 return GetNode().IsTransparent();
1043 void Actor::SetDrawMode(DrawMode::Type drawMode)
1045 // this flag is not animatable so keep the value
1046 mDrawMode = drawMode;
1048 // node is being used in a separate thread; queue a message to set the value
1049 SetDrawModeMessage(GetEventThreadServices(), GetNode(), drawMode);
1052 bool Actor::ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const
1054 return mScene && OnScene() && ConvertScreenToLocalRenderTaskList(mScene->GetRenderTaskList(), GetNode().GetWorldMatrix(0), GetCurrentSize(), localX, localY, screenX, screenY);
1057 bool Actor::ScreenToLocal(const RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY) const
1059 return OnScene() && ConvertScreenToLocalRenderTask(renderTask, GetNode().GetWorldMatrix(0), GetCurrentSize(), localX, localY, screenX, screenY);
1062 bool Actor::ScreenToLocal(const Matrix& viewMatrix, const Matrix& projectionMatrix, const Viewport& viewport, float& localX, float& localY, float screenX, float screenY) const
1064 return OnScene() && ConvertScreenToLocal(viewMatrix, projectionMatrix, GetNode().GetWorldMatrix(0), GetCurrentSize(), viewport, localX, localY, screenX, screenY);
1067 ActorGestureData& Actor::GetGestureData()
1069 // Likely scenario is that once gesture-data is created for this actor, the actor will require
1070 // that gesture for its entire life-time so no need to destroy it until the actor is destroyed
1071 if(nullptr == mGestureData)
1073 mGestureData = new ActorGestureData;
1075 return *mGestureData;
1078 bool Actor::IsGestureRequired(GestureType::Value type) const
1080 return mGestureData && mGestureData->IsGestureRequired(type);
1083 bool Actor::EmitInterceptTouchEventSignal(const Dali::TouchEvent& touch)
1085 return EmitConsumingSignal(*this, mInterceptTouchedSignal, touch);
1088 bool Actor::EmitTouchEventSignal(const Dali::TouchEvent& touch)
1090 return EmitConsumingSignal(*this, mTouchedSignal, touch);
1093 bool Actor::EmitHoverEventSignal(const Dali::HoverEvent& event)
1095 return EmitConsumingSignal(*this, mHoveredSignal, event);
1098 bool Actor::EmitWheelEventSignal(const Dali::WheelEvent& event)
1100 return EmitConsumingSignal(*this, mWheelEventSignal, event);
1103 void Actor::EmitVisibilityChangedSignal(bool visible, DevelActor::VisibilityChange::Type type)
1105 EmitSignal(*this, mVisibilityChangedSignal, visible, type);
1108 void Actor::EmitLayoutDirectionChangedSignal(LayoutDirection::Type type)
1110 EmitSignal(*this, mLayoutDirectionChangedSignal, type);
1113 DevelActor::ChildChangedSignalType& Actor::ChildAddedSignal()
1115 return mParentImpl.ChildAddedSignal();
1118 DevelActor::ChildChangedSignalType& Actor::ChildRemovedSignal()
1120 return mParentImpl.ChildRemovedSignal();
1123 DevelActor::ChildOrderChangedSignalType& Actor::ChildOrderChangedSignal()
1125 return mParentImpl.ChildOrderChangedSignal();
1128 bool Actor::DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor)
1130 bool connected(true);
1131 Actor* actor = static_cast<Actor*>(object); // TypeRegistry guarantees that this is the correct type.
1133 std::string_view name(signalName);
1135 if(name == SIGNAL_HOVERED)
1137 actor->HoveredSignal().Connect(tracker, functor);
1139 else if(signalName == SIGNAL_WHEEL_EVENT)
1141 actor->WheelEventSignal().Connect(tracker, functor);
1143 else if(name == SIGNAL_ON_SCENE)
1145 actor->OnSceneSignal().Connect(tracker, functor);
1147 else if(name == SIGNAL_OFF_SCENE)
1149 actor->OffSceneSignal().Connect(tracker, functor);
1151 else if(name == SIGNAL_ON_RELAYOUT)
1153 actor->OnRelayoutSignal().Connect(tracker, functor);
1155 else if(name == SIGNAL_TOUCHED)
1157 actor->TouchedSignal().Connect(tracker, functor);
1159 else if(name == SIGNAL_VISIBILITY_CHANGED)
1161 actor->VisibilityChangedSignal().Connect(tracker, functor);
1163 else if(name == SIGNAL_LAYOUT_DIRECTION_CHANGED)
1165 actor->LayoutDirectionChangedSignal().Connect(tracker, functor);
1167 else if(name == SIGNAL_CHILD_ADDED)
1169 actor->ChildAddedSignal().Connect(tracker, functor);
1171 else if(name == SIGNAL_CHILD_REMOVED)
1173 actor->ChildRemovedSignal().Connect(tracker, functor);
1177 // signalName does not match any signal
1184 Actor::Actor(DerivedType derivedType, const SceneGraph::Node& node)
1189 mRenderers(nullptr),
1190 mParentOrigin(nullptr),
1191 mAnchorPoint(nullptr),
1192 mRelayoutData(nullptr),
1193 mGestureData(nullptr),
1194 mInterceptTouchedSignal(),
1197 mWheelEventSignal(),
1200 mOnRelayoutSignal(),
1201 mVisibilityChangedSignal(),
1202 mLayoutDirectionChangedSignal(),
1203 mTargetOrientation(Quaternion::IDENTITY),
1204 mTargetColor(Color::WHITE),
1205 mTargetSize(Vector3::ZERO),
1206 mTargetPosition(Vector3::ZERO),
1207 mTargetScale(Vector3::ONE),
1208 mAnimatedSize(Vector3::ZERO),
1209 mTouchAreaOffset(0, 0, 0, 0),
1213 mUseAnimatedSize(AnimatedSizeFlag::CLEAR),
1214 mIsRoot(ROOT_LAYER == derivedType),
1215 mIsLayer(LAYER == derivedType || ROOT_LAYER == derivedType),
1218 mLeaveRequired(false),
1219 mKeyboardFocusable(false),
1220 mKeyboardFocusableChildren(true),
1221 mTouchFocusable(false),
1222 mOnSceneSignalled(false),
1223 mInsideOnSizeSet(false),
1224 mInheritPosition(true),
1225 mInheritOrientation(true),
1226 mInheritScale(true),
1227 mPositionUsesAnchorPoint(true),
1229 mInheritLayoutDirection(true),
1230 mCaptureAllTouchAfterStart(false),
1231 mIsBlendEquationSet(false),
1232 mNeedGesturePropagation(false),
1233 mLayoutDirection(LayoutDirection::LEFT_TO_RIGHT),
1234 mDrawMode(DrawMode::NORMAL),
1235 mColorMode(Node::DEFAULT_COLOR_MODE),
1236 mClippingMode(ClippingMode::DISABLED),
1237 mBlendEquation(DevelBlendEquation::ADD)
1241 void Actor::Initialize()
1245 GetEventThreadServices().RegisterObject(this);
1250 // Remove mParent pointers from children even if we're destroying core,
1251 // to guard against GetParent() & Unparent() calls from CustomActor destructors.
1255 // Guard to allow handle destruction after Core has been destroyed
1256 if(EventThreadServices::IsCoreRunning())
1258 // Root layer will destroy its node in its own destructor
1261 DestroyNodeMessage(GetEventThreadServices().GetUpdateManager(), GetNode());
1263 GetEventThreadServices().UnregisterObject(this);
1267 // Cleanup optional gesture data
1268 delete mGestureData;
1270 // Cleanup optional parent origin and anchor
1271 delete mParentOrigin;
1272 delete mAnchorPoint;
1274 // Delete optional relayout data
1275 delete mRelayoutData;
1278 void Actor::Add(Actor& child, bool notify)
1280 mParentImpl.Add(child, notify);
1283 void Actor::Remove(Actor& child, bool notify)
1285 mParentImpl.Remove(child, notify);
1288 void Actor::SwitchParent(Actor& newParent)
1290 if(this == &newParent)
1292 DALI_LOG_ERROR("Cannot add actor to itself");
1296 if(!this->OnScene() || !newParent.OnScene())
1298 DALI_LOG_ERROR("Both of current parent and new parent must be on Scene");
1302 newParent.Add(*this, false);
1305 uint32_t Actor::GetChildCount() const
1307 return mParentImpl.GetChildCount();
1310 ActorPtr Actor::GetChildAt(uint32_t index) const
1312 return mParentImpl.GetChildAt(index);
1315 ActorContainer& Actor::GetChildrenInternal()
1317 return mParentImpl.GetChildrenInternal();
1320 ActorPtr Actor::FindChildByName(ConstString actorName)
1322 return mParentImpl.FindChildByName(actorName);
1325 ActorPtr Actor::FindChildById(const uint32_t id)
1327 return mParentImpl.FindChildById(id);
1330 void Actor::UnparentChildren()
1332 mParentImpl.UnparentChildren();
1335 void Actor::ConnectToScene(uint32_t parentDepth, bool notify)
1337 // This container is used instead of walking the Actor hierarchy.
1338 // It protects us when the Actor hierarchy is modified during OnSceneConnectionExternal callbacks.
1339 ActorContainer connectionList;
1343 mScene->RequestRebuildDepthTree();
1346 // This stage is not interrupted by user callbacks.
1347 mParentImpl.RecursiveConnectToScene(connectionList, parentDepth + 1);
1349 // Notify applications about the newly connected actors.
1350 for(const auto& actor : connectionList)
1352 actor->NotifyStageConnection(notify);
1359 * This method is called when the Actor is connected to the Stage.
1360 * The parent must have added its Node to the scene-graph.
1361 * The child must connect its Node to the parent's Node.
1362 * This is recursive; the child calls ConnectToScene() for its children.
1364 void Actor::ConnectToSceneGraph()
1366 DALI_ASSERT_DEBUG(mParent != NULL);
1368 // Reparent Node in next Update
1369 ConnectNodeMessage(GetEventThreadServices().GetUpdateManager(), GetParent()->GetNode(), GetNode());
1371 // Request relayout on all actors that are added to the scenegraph
1374 // Notification for Object::Observers
1378 void Actor::NotifyStageConnection(bool notify)
1380 // Actors can be removed (in a callback), before the on-stage stage is reported.
1381 // The actor may also have been reparented, in which case mOnSceneSignalled will be true.
1382 if(OnScene() && !mOnSceneSignalled)
1386 // Notification for external (CustomActor) derived classes
1387 OnSceneConnectionExternal(mDepth);
1389 if(!mOnSceneSignal.Empty())
1391 Dali::Actor handle(this);
1392 mOnSceneSignal.Emit(handle);
1396 // Guard against Remove during callbacks
1399 mOnSceneSignalled = true; // signal required next time Actor is removed
1404 void Actor::DisconnectFromStage(bool notify)
1406 // This container is used instead of walking the Actor hierachy.
1407 // It protects us when the Actor hierachy is modified during OnSceneDisconnectionExternal callbacks.
1408 ActorContainer disconnectionList;
1412 mScene->RequestRebuildDepthTree();
1415 // This stage is not interrupted by user callbacks
1416 mParentImpl.RecursiveDisconnectFromScene(disconnectionList);
1418 // Notify applications about the newly disconnected actors.
1419 for(const auto& actor : disconnectionList)
1421 actor->NotifyStageDisconnection(notify);
1426 * This method is called by an actor or its parent, before a node removal message is sent.
1427 * This is recursive; the child calls DisconnectFromStage() for its children.
1429 void Actor::DisconnectFromSceneGraph()
1431 // Notification for Object::Observers
1432 OnSceneObjectRemove();
1435 void Actor::NotifyStageDisconnection(bool notify)
1437 // Actors can be added (in a callback), before the off-stage state is reported.
1438 // Also if the actor was added & removed before mOnSceneSignalled was set, then we don't notify here.
1439 // only do this step if there is a stage, i.e. Core is not being shut down
1440 if(EventThreadServices::IsCoreRunning() && !OnScene() && mOnSceneSignalled)
1444 // Notification for external (CustomeActor) derived classes
1445 OnSceneDisconnectionExternal();
1447 if(!mOffSceneSignal.Empty())
1449 Dali::Actor handle(this);
1450 mOffSceneSignal.Emit(handle);
1454 // Guard against Add during callbacks
1457 mOnSceneSignalled = false; // signal required next time Actor is added
1462 bool Actor::IsNodeConnected() const
1464 return OnScene() && (IsRoot() || GetNode().GetParent());
1467 // This method initiates traversal of the actor tree using depth-first
1468 // traversal to set a depth index based on traversal order. It sends a
1469 // single message to update manager to update all the actor's nodes in
1470 // this tree with the depth index. The sceneGraphNodeDepths vector's
1471 // elements are ordered by depth, and could be used to reduce sorting
1472 // in the update thread.
1473 void Actor::RebuildDepthTree()
1475 DALI_LOG_TIMER_START(depthTimer);
1477 // Vector of scene-graph nodes and their depths to send to UpdateManager
1478 // in a single message
1479 OwnerPointer<SceneGraph::NodeDepths> sceneGraphNodeDepths(new SceneGraph::NodeDepths());
1481 int32_t depthIndex = 1;
1482 mParentImpl.DepthTraverseActorTree(sceneGraphNodeDepths, depthIndex);
1484 SetDepthIndicesMessage(GetEventThreadServices().GetUpdateManager(), sceneGraphNodeDepths);
1485 DALI_LOG_TIMER_END(depthTimer, gLogFilter, Debug::Concise, "Depth tree traversal time: ");
1488 void Actor::SetDefaultProperty(Property::Index index, const Property::Value& property)
1490 PropertyHandler::SetDefaultProperty(*this, index, property);
1493 // TODO: This method needs to be removed
1494 void Actor::SetSceneGraphProperty(Property::Index index, const PropertyMetadata& entry, const Property::Value& value)
1496 PropertyHandler::SetSceneGraphProperty(index, entry, value, GetEventThreadServices(), GetNode());
1499 Property::Value Actor::GetDefaultProperty(Property::Index index) const
1501 Property::Value value;
1503 if(!GetCachedPropertyValue(index, value))
1505 // If property value is not stored in the event-side, then it must be a scene-graph only property
1506 GetCurrentPropertyValue(index, value);
1512 Property::Value Actor::GetDefaultPropertyCurrentValue(Property::Index index) const
1514 Property::Value value;
1516 if(!GetCurrentPropertyValue(index, value))
1518 // If unable to retrieve scene-graph property value, then it must be an event-side only property
1519 GetCachedPropertyValue(index, value);
1525 void Actor::OnNotifyDefaultPropertyAnimation(Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType)
1527 PropertyHandler::OnNotifyDefaultPropertyAnimation(*this, animation, index, value, animationType);
1530 const PropertyBase* Actor::GetSceneObjectAnimatableProperty(Property::Index index) const
1532 const PropertyBase* property = PropertyHandler::GetSceneObjectAnimatableProperty(index, GetNode());
1535 // not our property, ask base
1536 property = Object::GetSceneObjectAnimatableProperty(index);
1542 const PropertyInputImpl* Actor::GetSceneObjectInputProperty(Property::Index index) const
1544 const PropertyInputImpl* property = PropertyHandler::GetSceneObjectInputProperty(index, GetNode());
1547 // reuse animatable property getter as animatable properties are inputs as well
1548 // animatable property chains back to Object::GetSceneObjectInputProperty() so all properties get covered
1549 property = GetSceneObjectAnimatableProperty(index);
1555 int32_t Actor::GetPropertyComponentIndex(Property::Index index) const
1557 int32_t componentIndex = PropertyHandler::GetPropertyComponentIndex(index);
1558 if(Property::INVALID_COMPONENT_INDEX == componentIndex)
1561 componentIndex = Object::GetPropertyComponentIndex(index);
1564 return componentIndex;
1567 const SceneGraph::Node& Actor::GetNode() const
1569 return *static_cast<const SceneGraph::Node*>(mUpdateObject);
1576 mParent->RaiseChild(*this);
1580 DALI_LOG_WARNING("Actor must have a parent, Sibling order not changed.\n");
1588 mParent->LowerChild(*this);
1592 DALI_LOG_WARNING("Actor must have a parent, Sibling order not changed.\n");
1596 void Actor::RaiseToTop()
1600 mParent->RaiseChildToTop(*this);
1604 DALI_LOG_WARNING("Actor must have a parent, Sibling order not changed.\n");
1608 void Actor::LowerToBottom()
1612 mParent->LowerChildToBottom(*this);
1616 DALI_LOG_WARNING("Actor must have a parent, Sibling order not changed.\n");
1620 void Actor::RaiseAbove(Internal::Actor& target)
1624 mParent->RaiseChildAbove(*this, target);
1628 DALI_LOG_WARNING("Actor must have a parent, Sibling order not changed.\n");
1632 void Actor::LowerBelow(Internal::Actor& target)
1636 mParent->LowerChildBelow(*this, target);
1640 DALI_LOG_WARNING("Actor must have a parent, Sibling order not changed.\n");
1644 void Actor::SetParent(ActorParent* parent, bool notify)
1648 DALI_ASSERT_ALWAYS(!mParent && "Actor cannot have 2 parents");
1651 Actor* parentActor = static_cast<Actor*>(parent);
1652 mScene = parentActor->mScene;
1654 if(EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
1655 parentActor->OnScene())
1657 // Instruct each actor to create a corresponding node in the scene graph
1658 ConnectToScene(parentActor->GetHierarchyDepth(), notify);
1661 // Resolve the name and index for the child properties if any
1662 ResolveChildProperties();
1664 else // parent being set to NULL
1666 DALI_ASSERT_ALWAYS(mParent != nullptr && "Actor should have a parent");
1670 if(EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
1673 // Disconnect the Node & its children from the scene-graph.
1674 DisconnectNodeMessage(GetEventThreadServices().GetUpdateManager(), GetNode());
1676 // Instruct each actor to discard pointers to the scene-graph
1677 DisconnectFromStage(notify);
1684 bool Actor::DoAction(BaseObject* object, const std::string& actionName, const Property::Map& /* attributes */)
1687 Actor* actor = dynamic_cast<Actor*>(object);
1691 std::string_view name(actionName);
1692 if(name == ACTION_SHOW)
1694 actor->SetVisible(true);
1697 else if(name == ACTION_HIDE)
1699 actor->SetVisible(false);
1707 Rect<> Actor::CalculateScreenExtents() const
1709 auto screenPosition = GetCurrentScreenPosition();
1710 Vector3 size = GetCurrentSize() * GetCurrentWorldScale();
1711 Vector3 anchorPointOffSet = size * (mPositionUsesAnchorPoint ? GetCurrentAnchorPoint() : AnchorPoint::TOP_LEFT);
1712 Vector2 position = Vector2(screenPosition.x - anchorPointOffSet.x, screenPosition.y - anchorPointOffSet.y);
1713 return {position.x, position.y, size.x, size.y};
1716 void Actor::SetNeedGesturePropagation(bool propagation)
1718 mNeedGesturePropagation = propagation;
1721 bool Actor::NeedGesturePropagation()
1723 return mNeedGesturePropagation;
1726 bool Actor::GetCachedPropertyValue(Property::Index index, Property::Value& value) const
1728 return PropertyHandler::GetCachedPropertyValue(*this, index, value);
1731 bool Actor::GetCurrentPropertyValue(Property::Index index, Property::Value& value) const
1733 return PropertyHandler::GetCurrentPropertyValue(*this, index, value);
1736 Actor::Relayouter& Actor::EnsureRelayouter()
1738 // Assign relayouter
1741 mRelayoutData = new Relayouter();
1744 return *mRelayoutData;
1747 bool Actor::RelayoutDependentOnParent(Dimension::Type dimension)
1749 // Check if actor is dependent on parent
1750 for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
1752 if((dimension & (1 << i)))
1754 const ResizePolicy::Type resizePolicy = GetResizePolicy(static_cast<Dimension::Type>(1 << i));
1755 if(resizePolicy == ResizePolicy::FILL_TO_PARENT || resizePolicy == ResizePolicy::SIZE_RELATIVE_TO_PARENT || resizePolicy == ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT)
1765 bool Actor::RelayoutDependentOnChildren(Dimension::Type dimension)
1767 // Check if actor is dependent on children
1768 for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
1770 if((dimension & (1 << i)))
1772 const ResizePolicy::Type resizePolicy = GetResizePolicy(static_cast<Dimension::Type>(1 << i));
1773 switch(resizePolicy)
1775 case ResizePolicy::FIT_TO_CHILDREN:
1776 case ResizePolicy::USE_NATURAL_SIZE: // i.e. For things that calculate their size based on children
1792 bool Actor::RelayoutDependentOnChildrenBase(Dimension::Type dimension)
1794 return Actor::RelayoutDependentOnChildren(dimension);
1797 bool Actor::RelayoutDependentOnDimension(Dimension::Type dimension, Dimension::Type dependentDimension)
1799 // Check each possible dimension and see if it is dependent on the input one
1800 for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
1802 if(dimension & (1 << i))
1804 return mRelayoutData->resizePolicies[i] == ResizePolicy::DIMENSION_DEPENDENCY && mRelayoutData->dimensionDependencies[i] == dependentDimension;
1811 void Actor::SetNegotiatedDimension(float negotiatedDimension, Dimension::Type dimension)
1813 for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
1815 if(dimension & (1 << i))
1817 mRelayoutData->negotiatedDimensions[i] = negotiatedDimension;
1822 float Actor::GetNegotiatedDimension(Dimension::Type dimension) const
1824 // If more than one dimension is requested, just return the first one found
1825 for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
1827 if((dimension & (1 << i)))
1829 return mRelayoutData->negotiatedDimensions[i];
1833 return 0.0f; // Default
1836 void Actor::SetPadding(const Vector2& padding, Dimension::Type dimension)
1838 EnsureRelayouter().SetPadding(padding, dimension);
1841 Vector2 Actor::GetPadding(Dimension::Type dimension) const
1845 // If more than one dimension is requested, just return the first one found
1846 for(uint32_t i = 0; i < Dimension::DIMENSION_COUNT; ++i)
1848 if((dimension & (1 << i)))
1850 return mRelayoutData->dimensionPadding[i];
1855 return Relayouter::DEFAULT_DIMENSION_PADDING;
1858 void Actor::SetLayoutNegotiated(bool negotiated, Dimension::Type dimension)
1860 EnsureRelayouter().SetLayoutNegotiated(negotiated, dimension);
1863 bool Actor::IsLayoutNegotiated(Dimension::Type dimension) const
1865 return mRelayoutData && mRelayoutData->IsLayoutNegotiated(dimension);
1868 float Actor::GetHeightForWidthBase(float width)
1870 const Vector3 naturalSize = GetNaturalSize();
1871 return naturalSize.width > 0.0f ? naturalSize.height * width / naturalSize.width : width;
1874 float Actor::GetWidthForHeightBase(float height)
1876 const Vector3 naturalSize = GetNaturalSize();
1877 return naturalSize.height > 0.0f ? naturalSize.width * height / naturalSize.height : height;
1880 float Actor::CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension)
1882 // Fill to parent, taking size mode factor into account
1883 switch(child.GetResizePolicy(dimension))
1885 case ResizePolicy::FILL_TO_PARENT:
1887 return GetLatestSize(dimension);
1890 case ResizePolicy::SIZE_RELATIVE_TO_PARENT:
1892 return GetLatestSize(dimension) * GetDimensionValue(child.GetProperty<Vector3>(Dali::Actor::Property::SIZE_MODE_FACTOR), dimension);
1895 case ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT:
1897 return GetLatestSize(dimension) + GetDimensionValue(child.GetProperty<Vector3>(Dali::Actor::Property::SIZE_MODE_FACTOR), dimension);
1902 return GetLatestSize(dimension);
1907 float Actor::CalculateChildSize(const Dali::Actor& child, Dimension::Type dimension)
1909 // Can be overridden in derived class
1910 return CalculateChildSizeBase(child, dimension);
1913 float Actor::GetHeightForWidth(float width)
1915 // Can be overridden in derived class
1916 return GetHeightForWidthBase(width);
1919 float Actor::GetWidthForHeight(float height)
1921 // Can be overridden in derived class
1922 return GetWidthForHeightBase(height);
1925 float Actor::GetLatestSize(Dimension::Type dimension) const
1927 return IsLayoutNegotiated(dimension) ? GetNegotiatedDimension(dimension) : GetSize(dimension);
1930 float Actor::GetRelayoutSize(Dimension::Type dimension) const
1932 Vector2 padding = GetPadding(dimension);
1934 return GetLatestSize(dimension) + padding.x + padding.y;
1937 float Actor::NegotiateFromParent(Dimension::Type dimension)
1939 Actor* parent = GetParent();
1942 Vector2 padding(GetPadding(dimension));
1943 Vector2 parentPadding(parent->GetPadding(dimension));
1944 return parent->CalculateChildSize(Dali::Actor(this), dimension) - parentPadding.x - parentPadding.y - padding.x - padding.y;
1950 float Actor::NegotiateFromChildren(Dimension::Type dimension)
1952 float maxDimensionPoint = 0.0f;
1954 for(uint32_t i = 0, count = GetChildCount(); i < count; ++i)
1956 ActorPtr child = GetChildAt(i);
1958 if(!child->RelayoutDependentOnParent(dimension))
1960 // Calculate the min and max points that the children range across
1961 float childPosition = GetDimensionValue(child->GetTargetPosition(), dimension);
1962 float dimensionSize = child->GetRelayoutSize(dimension);
1963 maxDimensionPoint = std::max(maxDimensionPoint, childPosition + dimensionSize);
1967 return maxDimensionPoint;
1970 float Actor::GetSize(Dimension::Type dimension) const
1972 return GetDimensionValue(mTargetSize, dimension);
1975 float Actor::GetNaturalSize(Dimension::Type dimension) const
1977 return GetDimensionValue(GetNaturalSize(), dimension);
1980 float Actor::CalculateSize(Dimension::Type dimension, const Vector2& maximumSize)
1982 switch(GetResizePolicy(dimension))
1984 case ResizePolicy::USE_NATURAL_SIZE:
1986 return GetNaturalSize(dimension);
1989 case ResizePolicy::FIXED:
1991 return GetDimensionValue(GetPreferredSize(), dimension);
1994 case ResizePolicy::USE_ASSIGNED_SIZE:
1996 return GetDimensionValue(maximumSize, dimension);
1999 case ResizePolicy::FILL_TO_PARENT:
2000 case ResizePolicy::SIZE_RELATIVE_TO_PARENT:
2001 case ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT:
2003 return NegotiateFromParent(dimension);
2006 case ResizePolicy::FIT_TO_CHILDREN:
2008 return NegotiateFromChildren(dimension);
2011 case ResizePolicy::DIMENSION_DEPENDENCY:
2013 const Dimension::Type dimensionDependency = GetDimensionDependency(dimension);
2016 if(dimension == Dimension::WIDTH && dimensionDependency == Dimension::HEIGHT)
2018 return GetWidthForHeight(GetNegotiatedDimension(Dimension::HEIGHT));
2021 if(dimension == Dimension::HEIGHT && dimensionDependency == Dimension::WIDTH)
2023 return GetHeightForWidth(GetNegotiatedDimension(Dimension::WIDTH));
2035 return 0.0f; // Default
2038 Vector2 Actor::ApplySizeSetPolicy(const Vector2& size)
2040 return mRelayoutData->ApplySizeSetPolicy(*this, size);
2043 void Actor::SetNegotiatedSize(RelayoutContainer& container)
2045 // Do the set actor size
2046 Vector2 negotiatedSize(GetLatestSize(Dimension::WIDTH), GetLatestSize(Dimension::HEIGHT));
2048 // Adjust for size set policy
2049 negotiatedSize = ApplySizeSetPolicy(negotiatedSize);
2051 // Lock the flag to stop recursive relayouts on set size
2052 mRelayoutData->insideRelayout = true;
2053 SetSize(negotiatedSize);
2054 mRelayoutData->insideRelayout = false;
2056 // Clear flags for all dimensions
2057 SetLayoutDirty(false);
2059 // Give deriving classes a chance to respond
2060 OnRelayout(negotiatedSize, container);
2062 if(!mOnRelayoutSignal.Empty())
2064 Dali::Actor handle(this);
2065 mOnRelayoutSignal.Emit(handle);
2069 void Actor::NegotiateSize(const Vector2& allocatedSize, RelayoutContainer& container)
2071 Relayouter::NegotiateSize(*this, allocatedSize, container);
2074 void Actor::SetUseAssignedSize(bool use, Dimension::Type dimension)
2078 mRelayoutData->SetUseAssignedSize(use, dimension);
2082 bool Actor::GetUseAssignedSize(Dimension::Type dimension) const
2084 return mRelayoutData && mRelayoutData->GetUseAssignedSize(dimension);
2087 void Actor::RelayoutRequest(Dimension::Type dimension)
2089 Internal::RelayoutController* relayoutController = Internal::RelayoutController::Get();
2090 if(relayoutController)
2092 Dali::Actor self(this);
2093 relayoutController->RequestRelayout(self, dimension);
2097 void Actor::SetPreferredSize(const Vector2& size)
2099 EnsureRelayouter().SetPreferredSize(*this, size);
2102 Vector2 Actor::GetPreferredSize() const
2104 return mRelayoutData ? Vector2(mRelayoutData->preferredSize) : Relayouter::DEFAULT_PREFERRED_SIZE;
2107 void Actor::SetMinimumSize(float size, Dimension::Type dimension)
2109 EnsureRelayouter().SetMinimumSize(size, dimension);
2113 float Actor::GetMinimumSize(Dimension::Type dimension) const
2115 return mRelayoutData ? mRelayoutData->GetMinimumSize(dimension) : 0.0f;
2118 void Actor::SetMaximumSize(float size, Dimension::Type dimension)
2120 EnsureRelayouter().SetMaximumSize(size, dimension);
2124 float Actor::GetMaximumSize(Dimension::Type dimension) const
2126 return mRelayoutData ? mRelayoutData->GetMaximumSize(dimension) : FLT_MAX;
2129 void Actor::SetVisibleInternal(bool visible, SendMessage::Type sendMessage)
2131 if(mVisible != visible)
2133 if(sendMessage == SendMessage::TRUE)
2135 // node is being used in a separate thread; queue a message to set the value & base value
2136 SceneGraph::NodePropertyMessage<bool>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mVisible, &AnimatableProperty<bool>::Bake, visible);
2138 RequestRenderingMessage(GetEventThreadServices().GetUpdateManager());
2143 // Emit the signal on this actor and all its children
2144 mParentImpl.EmitVisibilityChangedSignalRecursively(visible, DevelActor::VisibilityChange::SELF);
2148 void Actor::SetSiblingOrderOfChild(Actor& child, uint32_t order)
2150 mParentImpl.SetSiblingOrderOfChild(child, order);
2153 uint32_t Actor::GetSiblingOrderOfChild(const Actor& child) const
2155 return mParentImpl.GetSiblingOrderOfChild(child);
2158 void Actor::RaiseChild(Actor& child)
2160 mParentImpl.RaiseChild(child);
2163 void Actor::LowerChild(Actor& child)
2165 mParentImpl.LowerChild(child);
2168 void Actor::RaiseChildToTop(Actor& child)
2170 mParentImpl.RaiseChildToTop(child);
2173 void Actor::LowerChildToBottom(Actor& child)
2175 mParentImpl.LowerChildToBottom(child);
2178 void Actor::RaiseChildAbove(Actor& child, Actor& target)
2180 mParentImpl.RaiseChildAbove(child, target);
2183 void Actor::LowerChildBelow(Actor& child, Actor& target)
2185 mParentImpl.LowerChildBelow(child, target);
2188 void Actor::SetInheritLayoutDirection(bool inherit)
2190 if(mInheritLayoutDirection != inherit)
2192 mInheritLayoutDirection = inherit;
2194 if(inherit && mParent)
2196 mParentImpl.InheritLayoutDirectionRecursively(GetParent()->mLayoutDirection);
2201 void Actor::SetUpdateSizeHint(const Vector2& updateSizeHint)
2203 // node is being used in a separate thread; queue a message to set the value & base value
2204 SceneGraph::NodePropertyMessage<Vector3>::Send(GetEventThreadServices(), &GetNode(), &GetNode().mUpdateSizeHint, &AnimatableProperty<Vector3>::Bake, Vector3(updateSizeHint.width, updateSizeHint.height, 0.f));
2207 } // namespace Internal