1 #ifndef DALI_INTERNAL_SCENE_GRAPH_NODE_H
2 #define DALI_INTERNAL_SCENE_GRAPH_NODE_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/actors/actor-enumerations.h>
23 #include <dali/public-api/actors/draw-mode.h>
24 #include <dali/devel-api/common/set-wrapper.h>
25 #include <dali/public-api/math/quaternion.h>
26 #include <dali/public-api/math/math-utils.h>
27 #include <dali/public-api/math/vector3.h>
28 #include <dali/integration-api/debug.h>
29 #include <dali/internal/common/message.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/render/data-providers/node-data-provider.h>
32 #include <dali/internal/update/common/animatable-property.h>
33 #include <dali/internal/update/common/property-owner.h>
34 #include <dali/internal/update/common/property-vector3.h>
35 #include <dali/internal/update/common/scene-graph-buffers.h>
36 #include <dali/internal/update/common/inherited-property.h>
37 #include <dali/internal/update/manager/transform-manager.h>
38 #include <dali/internal/update/manager/transform-manager-property.h>
39 #include <dali/internal/update/nodes/node-declarations.h>
40 #include <dali/internal/update/rendering/scene-graph-renderer.h>
48 // Value types used by messages.
49 template <> struct ParameterType< ColorMode > : public BasicType< ColorMode > {};
50 template <> struct ParameterType< PositionInheritanceMode > : public BasicType< PositionInheritanceMode > {};
51 template <> struct ParameterType< ClippingMode::Type > : public BasicType< ClippingMode::Type > {};
62 * Flag whether property has changed, during the Update phase.
64 enum NodePropertyFlags
67 TransformFlag = 0x001,
72 SortModifierFlag = 0x020,
73 ChildDeletedFlag = 0x040,
76 static const int AllFlags = ( ChildDeletedFlag << 1 ) - 1; // all the flags
79 * Size is not inherited. VisibleFlag is inherited
81 static const int InheritedDirtyFlags = TransformFlag | VisibleFlag | ColorFlag | OverlayFlag;
83 // Flags which require the scene renderable lists to be updated
84 static const int RenderableUpdateFlags = TransformFlag | SortModifierFlag | ChildDeletedFlag;
87 * Node is the base class for all nodes in the Scene Graph.
89 * Each node provides a transformation which applies to the node and
90 * its children. Node data is double-buffered. This allows an update
91 * thread to modify node data, without interferring with another
92 * thread reading the values from the previous update traversal.
94 class Node : public PropertyOwner, public NodeDataProvider
99 static const PositionInheritanceMode DEFAULT_POSITION_INHERITANCE_MODE;
100 static const ColorMode DEFAULT_COLOR_MODE;
105 * Construct a new Node.
115 * Overriden delete operator
116 * Deletes the node from its global memory pool
118 void operator delete( void* ptr );
121 * Called during UpdateManager::DestroyNode shortly before Node is destroyed.
128 * Query whether the node is a layer.
129 * @return True if the node is a layer.
133 return (GetLayer() != NULL);
137 * Convert a node to a layer.
138 * @return A pointer to the layer, or NULL.
140 virtual Layer* GetLayer()
146 * This method sets clipping information on the node based on its hierarchy in the scene-graph.
147 * A value is calculated that can be used during sorting to increase sort speed.
148 * @param[in] clippingId The Clipping ID of the node to set
149 * @param[in] clippingDepth The Clipping Depth of the node to set
151 void SetClippingInformation( const uint32_t clippingId, const uint32_t clippingDepth )
153 // We only set up the sort value if we have a clipping depth, IE. At least 1 clipping node has been hit.
154 // If not, if we traverse down a clipping tree and back up, and there is another
155 // node on the parent, this will have a non-zero clipping ID that must be ignored
156 if( DALI_LIKELY( clippingDepth > 0u ) )
158 mClippingDepth = clippingDepth;
160 // Calculate the sort value here on write, as when read (during sort) it may be accessed several times.
161 // The items must be sorted by Clipping ID first (so the ID is kept in the most-significant bits).
162 // For the same ID, the clipping nodes must be first, so we negate the
163 // clipping enabled flag and set it as the least significant bit.
164 mClippingSortModifier = ( clippingId << 1u ) | ( mClippingMode == ClippingMode::DISABLED ? 1u : 0u );
168 // If we do not have a clipping depth, then set this to 0 so we do not have a Clipping ID either.
169 mClippingSortModifier = 0u;
174 * Gets the Clipping ID for this node.
175 * @return The Clipping ID for this node.
177 uint32_t GetClippingId() const
179 return mClippingSortModifier >> 1u;
183 * Gets the Clipping Depth for this node.
184 * @return The Clipping Depth for this node.
186 uint32_t GetClippingDepth() const
188 return mClippingDepth;
192 * Sets the clipping mode for this node.
193 * @param[in] clippingMode The ClippingMode to set
195 void SetClippingMode( const ClippingMode::Type clippingMode )
197 mClippingMode = clippingMode;
201 * Gets the Clipping Mode for this node.
202 * @return The ClippingMode of this node
204 ClippingMode::Type GetClippingMode() const
206 return mClippingMode;
210 * Add a renderer to the node
211 * @param[in] renderer The renderer added to the node
213 void AddRenderer( Renderer* renderer );
216 * Remove a renderer from the node
217 * @param[in] renderer The renderer to be removed
219 void RemoveRenderer( Renderer* renderer );
222 * Get the renderer at the given index
225 Renderer* GetRendererAt( unsigned int index ) const
227 return mRenderer[index];
231 * Retrieve the number of renderers for the node
233 unsigned int GetRendererCount()
235 return mRenderer.Size();
238 // Containment methods
241 * Query whether a node is the root node. Root nodes cannot have a parent node.
242 * A node becomes a root node, when it is installed by UpdateManager.
243 * @return True if the node is a root node.
251 * Set whether a node is the root node. Root nodes cannot have a parent node.
252 * This method should only be called by UpdateManager.
253 * @pre When isRoot is true, the node must not have a parent.
254 * @param[in] isRoot Whether the node is now a root node.
256 void SetRoot(bool isRoot);
259 * Retrieve the parent of a Node.
260 * @return The parent node, or NULL if the Node has not been added to the scene-graph.
268 * Retrieve the parent of a Node.
269 * @return The parent node, or NULL if the Node has not been added to the scene-graph.
271 const Node* GetParent() const
277 * Connect a node to the scene-graph.
278 * @pre A node cannot be added to itself.
279 * @pre The parent node is connected to the scene-graph.
280 * @pre The childNode does not already have a parent.
281 * @pre The childNode is not a root node.
282 * @param[in] childNode The child to add.
284 void ConnectChild( Node* childNode );
287 * Disconnect a child (& its children) from the scene-graph.
288 * @pre childNode is a child of this Node.
289 * @param[in] updateBufferIndex The current update buffer index.
290 * @param[in] childNode The node to disconnect.
292 void DisconnectChild( BufferIndex updateBufferIndex, Node& childNode );
295 * Retrieve the children a Node.
296 * @return The container of children.
298 const NodeContainer& GetChildren() const
304 * Retrieve the children a Node.
305 * @return The container of children.
307 NodeContainer& GetChildren()
315 * Flag that one of the node values has changed in the current frame.
316 * @param[in] flag The flag to set.
318 void SetDirtyFlag(NodePropertyFlags flag)
324 * Flag that all of the node values are dirty.
326 void SetAllDirtyFlags()
328 mDirtyFlags = AllFlags;
332 * Query whether a node is dirty.
333 * @return The dirty flags
335 int GetDirtyFlags() const;
338 * Query whether a node is clean.
339 * @return True if the node is clean.
343 return ( NothingFlag == GetDirtyFlags() );
347 * Retrieve the parent-origin of the node.
348 * @return The parent-origin.
350 const Vector3& GetParentOrigin() const
352 return mParentOrigin.Get(0);
356 * Sets both the local & base parent-origins of the node.
357 * @param[in] origin The new local & base parent-origins.
359 void SetParentOrigin(const Vector3& origin)
361 mParentOrigin.Set(0,origin );
365 * Retrieve the anchor-point of the node.
366 * @return The anchor-point.
368 const Vector3& GetAnchorPoint() const
370 return mAnchorPoint.Get(0);
374 * Sets both the local & base anchor-points of the node.
375 * @param[in] anchor The new local & base anchor-points.
377 void SetAnchorPoint(const Vector3& anchor)
379 mAnchorPoint.Set(0, anchor );
383 * Retrieve the local position of the node, relative to its parent.
384 * @param[in] bufferIndex The buffer to read from.
385 * @return The local position.
387 const Vector3& GetPosition(BufferIndex bufferIndex) const
389 if( mTransformId != INVALID_TRANSFORM_ID )
391 return mPosition.Get(bufferIndex);
394 return Vector3::ZERO;
398 * Retrieve the position of the node derived from the position of all its parents.
399 * @return The world position.
401 const Vector3& GetWorldPosition( BufferIndex bufferIndex ) const
403 return mWorldPosition.Get(bufferIndex);
407 * Set whether the Node inherits position.
408 * @param[in] inherit True if the parent position is inherited.
410 void SetInheritPosition(bool inherit)
412 if( mTransformId != INVALID_TRANSFORM_ID )
414 mTransformManager->SetInheritPosition( mTransformId, inherit );
419 * Retrieve the local orientation of the node, relative to its parent.
420 * @param[in] bufferIndex The buffer to read from.
421 * @return The local orientation.
423 const Quaternion& GetOrientation(BufferIndex bufferIndex) const
425 if( mTransformId != INVALID_TRANSFORM_ID )
427 return mOrientation.Get(0);
430 return Quaternion::IDENTITY;
434 * Retrieve the orientation of the node derived from the rotation of all its parents.
435 * @param[in] bufferIndex The buffer to read from.
436 * @return The world rotation.
438 const Quaternion& GetWorldOrientation( BufferIndex bufferIndex ) const
440 return mWorldOrientation.Get(0);
444 * Set whether the Node inherits orientation.
445 * @param[in] inherit True if the parent orientation is inherited.
447 void SetInheritOrientation(bool inherit)
449 if( mTransformId != INVALID_TRANSFORM_ID )
451 mTransformManager->SetInheritOrientation(mTransformId, inherit );
456 * Retrieve the local scale of the node, relative to its parent.
457 * @param[in] bufferIndex The buffer to read from.
458 * @return The local scale.
460 const Vector3& GetScale(BufferIndex bufferIndex) const
462 if( mTransformId != INVALID_TRANSFORM_ID )
464 return mScale.Get(0);
472 * Retrieve the scale of the node derived from the scale of all its parents.
473 * @param[in] bufferIndex The buffer to read from.
474 * @return The world scale.
476 const Vector3& GetWorldScale( BufferIndex bufferIndex ) const
478 return mWorldScale.Get(0);
482 * Set whether the Node inherits scale.
483 * @param inherit True if the Node inherits scale.
485 void SetInheritScale( bool inherit )
487 if( mTransformId != INVALID_TRANSFORM_ID )
489 mTransformManager->SetInheritScale(mTransformId, inherit );
494 * Retrieve the visibility of the node.
495 * @param[in] bufferIndex The buffer to read from.
496 * @return True if the node is visible.
498 bool IsVisible(BufferIndex bufferIndex) const
500 return mVisible[bufferIndex];
504 * Retrieve the opacity of the node.
505 * @param[in] bufferIndex The buffer to read from.
506 * @return The opacity.
508 float GetOpacity(BufferIndex bufferIndex) const
510 return mColor[bufferIndex].a;
514 * Retrieve the color of the node.
515 * @param[in] bufferIndex The buffer to read from.
518 const Vector4& GetColor(BufferIndex bufferIndex) const
520 return mColor[bufferIndex];
524 * Sets the color of the node derived from the color of all its parents.
525 * @param[in] color The world color.
526 * @param[in] updateBufferIndex The current update buffer index.
528 void SetWorldColor(const Vector4& color, BufferIndex updateBufferIndex)
530 mWorldColor.Set( updateBufferIndex, color );
534 * Sets the color of the node derived from the color of all its parents.
535 * This method should only be called when the parents world color is up-to-date.
536 * @pre The node has a parent.
537 * @param[in] updateBufferIndex The current update buffer index.
539 void InheritWorldColor( BufferIndex updateBufferIndex )
541 DALI_ASSERT_DEBUG(mParent != NULL);
544 if( mColorMode == USE_OWN_MULTIPLY_PARENT_ALPHA )
546 const Vector4& ownColor = mColor[updateBufferIndex];
547 mWorldColor.Set( updateBufferIndex, ownColor.r, ownColor.g, ownColor.b, ownColor.a * mParent->GetWorldColor(updateBufferIndex).a );
549 else if( mColorMode == USE_OWN_MULTIPLY_PARENT_COLOR )
551 mWorldColor.Set( updateBufferIndex, mParent->GetWorldColor(updateBufferIndex) * mColor[updateBufferIndex] );
553 else if( mColorMode == USE_PARENT_COLOR )
555 mWorldColor.Set( updateBufferIndex, mParent->GetWorldColor(updateBufferIndex) );
557 else // USE_OWN_COLOR
559 mWorldColor.Set( updateBufferIndex, mColor[updateBufferIndex] );
564 * Copies the previous inherited scale, if this changed in the previous frame.
565 * This method should be called instead of InheritWorldScale i.e. if the inherited scale
566 * does not need to be recalculated in the current frame.
567 * @param[in] updateBufferIndex The current update buffer index.
569 void CopyPreviousWorldColor( BufferIndex updateBufferIndex )
571 mWorldColor.CopyPrevious( updateBufferIndex );
575 * Retrieve the color of the node, possibly derived from the color
576 * of all its parents, depending on the value of mColorMode.
577 * @param[in] bufferIndex The buffer to read from.
578 * @return The world color.
580 const Vector4& GetWorldColor(BufferIndex bufferIndex) const
582 return mWorldColor[bufferIndex];
586 * Set the color mode. This specifies whether the Node uses its own color,
587 * or inherits its parent color.
588 * @param[in] colorMode The new color mode.
590 void SetColorMode(ColorMode colorMode)
592 mColorMode = colorMode;
594 SetDirtyFlag(ColorFlag);
598 * Retrieve the color mode.
599 * @return The color mode.
601 ColorMode GetColorMode() const
607 * Retrieve the size of the node.
608 * @param[in] bufferIndex The buffer to read from.
611 const Vector3& GetSize(BufferIndex bufferIndex) const
613 if( mTransformId != INVALID_TRANSFORM_ID )
618 return Vector3::ZERO;
622 * Retrieve the bounding sphere of the node
623 * @return A vector4 describing the bounding sphere. XYZ is the center and W is the radius
625 const Vector4& GetBoundingSphere() const
627 if( mTransformId != INVALID_TRANSFORM_ID )
629 return mTransformManager->GetBoundingSphere( mTransformId );
632 return Vector4::ZERO;
636 * Retrieve world matrix and size of the node
637 * @param[out] The local to world matrix of the node
638 * @param[out] size The current size of the node
640 void GetWorldMatrixAndSize( Matrix& worldMatrix, Vector3& size ) const
642 if( mTransformId != INVALID_TRANSFORM_ID )
644 mTransformManager->GetWorldMatrixAndSize( mTransformId, worldMatrix, size );
649 * Checks if local matrix has changed since last update
650 * @return true if local matrix has changed, false otherwise
652 bool IsLocalMatrixDirty() const
654 return (mTransformId != INVALID_TRANSFORM_ID) &&
655 (mTransformManager->IsLocalMatrixDirty( mTransformId ));
659 * Retrieve the cached world-matrix of a node.
660 * @param[in] bufferIndex The buffer to read from.
661 * @return The world-matrix.
663 const Matrix& GetWorldMatrix( BufferIndex bufferIndex ) const
665 return mWorldMatrix.Get(bufferIndex);
669 * Mark the node as exclusive to a single RenderTask.
670 * @param[in] renderTask The render-task, or NULL if the Node is not exclusive to a single RenderTask.
672 void SetExclusiveRenderTask( RenderTask* renderTask )
674 mExclusiveRenderTask = renderTask;
678 * Query whether the node is exclusive to a single RenderTask.
679 * @return The render-task, or NULL if the Node is not exclusive to a single RenderTask.
681 RenderTask* GetExclusiveRenderTask() const
683 return mExclusiveRenderTask;
687 * Set how the Node and its children should be drawn; see Dali::Actor::SetDrawMode() for more details.
688 * @param[in] drawMode The new draw-mode to use.
690 void SetDrawMode( const DrawMode::Type& drawMode )
692 mDrawMode = drawMode;
696 * Returns whether node is an overlay or not.
697 * @return True if node is an overlay, false otherwise.
699 DrawMode::Type GetDrawMode() const
705 * Returns the transform id of the node
706 * @return The transform component id of the node
708 TransformId GetTransformId() const
714 * Equality operator, checks for identity, not values.
717 bool operator==( const Node* rhs ) const
719 return ( this == rhs );
723 * @brief Sets the sibling order of the node
724 * @param[in] order The new order
726 void SetDepthIndex( unsigned int depthIndex ){ mDepthIndex = depthIndex; }
729 * @brief Get the depth index of the node
730 * @return Current depth index
732 unsigned int GetDepthIndex(){ return mDepthIndex; }
736 * @copydoc UniformMap::Add
738 void AddUniformMapping( UniformPropertyMapping* map );
741 * @copydoc UniformMap::Remove
743 void RemoveUniformMapping( const std::string& uniformName );
746 * Prepare the node for rendering.
747 * This is called by the UpdateManager when an object is due to be rendered in the current frame.
748 * @param[in] updateBufferIndex The current update buffer index.
750 void PrepareRender( BufferIndex bufferIndex );
753 * Called by UpdateManager when the node is added.
754 * Creates a new transform component in the transform manager and initialize all the properties
755 * related to the transformation
756 * @param[in] transformManager A pointer to the trnasform manager (Owned by UpdateManager)
758 void CreateTransform( SceneGraph::TransformManager* transformManager );
763 * Set the parent of a Node.
764 * @param[in] parentNode the new parent.
766 void SetParent( Node& parentNode );
771 * Protected constructor; See also Node::New()
775 private: // from NodeDataProvider
778 * @copydoc NodeDataProvider::GetModelMatrix
780 virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const
782 return GetWorldMatrix( bufferId );
786 * @copydoc NodeDataProvider::GetRenderColor
788 virtual const Vector4& GetRenderColor( unsigned int bufferId ) const
790 return GetWorldColor( bufferId );
793 public: // From UniformMapDataProvider
795 * @copydoc UniformMapDataProvider::GetUniformMapChanged
797 virtual bool GetUniformMapChanged( BufferIndex bufferIndex ) const
799 return mUniformMapChanged[bufferIndex];
803 * @copydoc UniformMapDataProvider::GetUniformMap
805 virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const
807 return mCollectedUniformMap[bufferIndex];
816 Node& operator=(const Node& rhs);
819 * @copydoc Dali::Internal::SceneGraph::PropertyOwner::ResetDefaultProperties()
821 virtual void ResetDefaultProperties( BufferIndex updateBufferIndex );
824 * Recursive helper to disconnect a Node and its children.
825 * Disconnected Nodes have no parent or children.
826 * @param[in] updateBufferIndex The current update buffer index.
828 void RecursiveDisconnectFromSceneGraph( BufferIndex updateBufferIndex );
830 public: // Default properties
832 TransformManager* mTransformManager;
833 TransformId mTransformId;
834 TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
835 TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
836 TransformManagerPropertyVector3 mSize; ///< Size is provided for layouting
837 TransformManagerPropertyVector3 mPosition; ///< Local transform; distance between parent-origin & anchor-point
838 TransformManagerPropertyQuaternion mOrientation; ///< Local transform; rotation relative to parent node
839 TransformManagerPropertyVector3 mScale; ///< Local transform; scale relative to parent node
841 AnimatableProperty<bool> mVisible; ///< Visibility can be inherited from the Node hierachy
842 AnimatableProperty<Vector4> mColor; ///< Color can be inherited from the Node hierarchy
844 // Inherited properties; read-only from public API
846 TransformManagerVector3Input mWorldPosition; ///< Full inherited position
847 TransformManagerVector3Input mWorldScale;
848 TransformManagerQuaternionInput mWorldOrientation; ///< Full inherited orientation
849 TransformManagerMatrixInput mWorldMatrix; ///< Full inherited world matrix
850 InheritedColor mWorldColor; ///< Full inherited color
852 uint32_t mClippingSortModifier; ///< Contains bit-packed clipping information for quick access when sorting
856 Node* mParent; ///< Pointer to parent node (a child is owned by its parent)
857 RenderTask* mExclusiveRenderTask; ///< Nodes can be marked as exclusive to a single RenderTask
859 RendererContainer mRenderer; ///< Container of renderers; not owned
861 NodeContainer mChildren; ///< Container of children; not owned
863 CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps of the node
864 unsigned int mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
865 uint32_t mClippingDepth; ///< The number of clipping nodes deep this node is
867 uint32_t mDepthIndex; ///< Depth index of the node
869 // flags, compressed to bitfield
870 unsigned int mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
871 int mDirtyFlags:8; ///< A composite set of flags for each of the Node properties
872 DrawMode::Type mDrawMode:2; ///< How the Node and its children should be drawn
873 ColorMode mColorMode:2; ///< Determines whether mWorldColor is inherited, 2 bits is enough
874 ClippingMode::Type mClippingMode:2; ///< The clipping mode of this node
875 bool mIsRoot:1; ///< True if the node cannot have a parent
877 // Changes scope, should be at end of class
878 DALI_LOG_OBJECT_STRING_DECLARATION;
883 inline void SetInheritOrientationMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
885 typedef MessageValue1< Node, bool > LocalType;
887 // Reserve some memory inside the message queue
888 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
890 // Construct message in the message queue memory; note that delete should not be called on the return value
891 new (slot) LocalType( &node, &Node::SetInheritOrientation, inherit );
894 inline void SetParentOriginMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& origin )
896 typedef MessageValue1< Node, Vector3 > LocalType;
898 // Reserve some memory inside the message queue
899 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
901 // Construct message in the message queue memory; note that delete should not be called on the return value
902 new (slot) LocalType( &node, &Node::SetParentOrigin, origin );
905 inline void SetAnchorPointMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& anchor )
907 typedef MessageValue1< Node, Vector3 > LocalType;
909 // Reserve some memory inside the message queue
910 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
912 // Construct message in the message queue memory; note that delete should not be called on the return value
913 new (slot) LocalType( &node, &Node::SetAnchorPoint, anchor );
916 inline void SetInheritPositionMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
918 typedef MessageValue1< Node, bool > LocalType;
920 // Reserve some memory inside the message queue
921 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
923 // Construct message in the message queue memory; note that delete should not be called on the return value
924 new (slot) LocalType( &node, &Node::SetInheritPosition, inherit );
927 inline void SetInheritScaleMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
929 typedef MessageValue1< Node, bool > LocalType;
931 // Reserve some memory inside the message queue
932 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
934 // Construct message in the message queue memory; note that delete should not be called on the return value
935 new (slot) LocalType( &node, &Node::SetInheritScale, inherit );
938 inline void SetColorModeMessage( EventThreadServices& eventThreadServices, const Node& node, ColorMode colorMode )
940 typedef MessageValue1< Node, ColorMode > LocalType;
942 // Reserve some memory inside the message queue
943 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
945 // Construct message in the message queue memory; note that delete should not be called on the return value
946 new (slot) LocalType( &node, &Node::SetColorMode, colorMode );
949 inline void SetDrawModeMessage( EventThreadServices& eventThreadServices, const Node& node, DrawMode::Type drawMode )
951 typedef MessageValue1< Node, DrawMode::Type > LocalType;
953 // Reserve some memory inside the message queue
954 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
956 // Construct message in the message queue memory; note that delete should not be called on the return value
957 new (slot) LocalType( &node, &Node::SetDrawMode, drawMode );
960 inline void AddRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
962 typedef MessageValue1< Node, Renderer* > LocalType;
964 // Reserve some memory inside the message queue
965 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
967 // Construct message in the message queue memory; note that delete should not be called on the return value
968 new (slot) LocalType( &node, &Node::AddRenderer, renderer );
971 inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
973 typedef MessageValue1< Node, Renderer* > LocalType;
975 // Reserve some memory inside the message queue
976 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
978 // Construct message in the message queue memory; note that delete should not be called on the return value
979 new (slot) LocalType( &node, &Node::RemoveRenderer, renderer );
982 inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, unsigned int depthIndex )
984 typedef MessageValue1< Node, unsigned int > LocalType;
986 // Reserve some memory inside the message queue
987 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
989 // Construct message in the message queue memory; note that delete should not be called on the return value
990 new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex );
993 inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, const Node& node, ClippingMode::Type clippingMode )
995 typedef MessageValue1< Node, ClippingMode::Type > LocalType;
997 // Reserve some memory inside the message queue
998 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1000 // Construct message in the message queue memory; note that delete should not be called on the return value
1001 new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode );
1005 } // namespace SceneGraph
1007 } // namespace Internal
1011 #endif // DALI_INTERNAL_SCENE_GRAPH_NODE_H