1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_NODE_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_NODE_H__
5 * Copyright (c) 2016 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 > {};
59 class GeometryBatcher;
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 * Add a renderer to the node
147 * @param[in] renderer The renderer added to the node
149 void AddRenderer( Renderer* renderer );
152 * Remove a renderer from the node
153 * @param[in] renderer The renderer to be removed
155 void RemoveRenderer( Renderer* renderer );
158 * Get the renderer at the given index
161 Renderer* GetRendererAt( unsigned int index ) const
163 return mRenderer[index];
167 * Retrieve the number of renderers for the node
169 unsigned int GetRendererCount()
171 return mRenderer.Size();
174 // Containment methods
177 * Query whether a node is the root node. Root nodes cannot have a parent node.
178 * A node becomes a root node, when it is installed by UpdateManager.
179 * @return True if the node is a root node.
187 * Set whether a node is the root node. Root nodes cannot have a parent node.
188 * This method should only be called by UpdateManager.
189 * @pre When isRoot is true, the node must not have a parent.
190 * @param[in] isRoot Whether the node is now a root node.
192 void SetRoot(bool isRoot);
195 * Retrieve the parent of a Node.
196 * @return The parent node, or NULL if the Node has not been added to the scene-graph.
204 * Retrieve the parent of a Node.
205 * @return The parent node, or NULL if the Node has not been added to the scene-graph.
207 const Node* GetParent() const
213 * Connect a node to the scene-graph.
214 * @pre A node cannot be added to itself.
215 * @pre The parent node is connected to the scene-graph.
216 * @pre The childNode does not already have a parent.
217 * @pre The childNode is not a root node.
218 * @param[in] childNode The child to add.
220 void ConnectChild( Node* childNode );
223 * Disconnect a child (& its children) from the scene-graph.
224 * @pre childNode is a child of this Node.
225 * @param[in] updateBufferIndex The current update buffer index.
226 * @param[in] childNode The node to disconnect.
228 void DisconnectChild( BufferIndex updateBufferIndex, Node& childNode );
231 * Retrieve the children a Node.
232 * @return The container of children.
234 const NodeContainer& GetChildren() const
240 * Retrieve the children a Node.
241 * @return The container of children.
243 NodeContainer& GetChildren()
251 * Flag that one of the node values has changed in the current frame.
252 * @param[in] flag The flag to set.
254 void SetDirtyFlag(NodePropertyFlags flag)
260 * Flag that all of the node values are dirty.
262 void SetAllDirtyFlags()
264 mDirtyFlags = AllFlags;
268 * Query whether a node is dirty.
269 * @return The dirty flags
271 int GetDirtyFlags() const;
274 * Query whether a node is clean.
275 * @return True if the node is clean.
279 return ( NothingFlag == GetDirtyFlags() );
283 * Retrieve the parent-origin of the node.
284 * @return The parent-origin.
286 const Vector3& GetParentOrigin() const
288 return mParentOrigin.Get(0);
292 * Sets both the local & base parent-origins of the node.
293 * @param[in] origin The new local & base parent-origins.
295 void SetParentOrigin(const Vector3& origin)
297 mParentOrigin.Set(0,origin );
301 * Retrieve the anchor-point of the node.
302 * @return The anchor-point.
304 const Vector3& GetAnchorPoint() const
306 return mAnchorPoint.Get(0);
310 * Sets both the local & base anchor-points of the node.
311 * @param[in] anchor The new local & base anchor-points.
313 void SetAnchorPoint(const Vector3& anchor)
315 mAnchorPoint.Set(0, anchor );
319 * Retrieve the local position of the node, relative to its parent.
320 * @param[in] bufferIndex The buffer to read from.
321 * @return The local position.
323 const Vector3& GetPosition(BufferIndex bufferIndex) const
325 if( mTransformId != INVALID_TRANSFORM_ID )
327 return mPosition.Get(bufferIndex);
330 return Vector3::ZERO;
334 * Retrieve the position of the node derived from the position of all its parents.
335 * @return The world position.
337 const Vector3& GetWorldPosition( BufferIndex bufferIndex ) const
339 return mWorldPosition.Get(bufferIndex);
343 * Set whether the Node inherits position.
344 * @param[in] inherit True if the parent position is inherited.
346 void SetInheritPosition(bool inherit)
348 if( mTransformId != INVALID_TRANSFORM_ID )
350 mTransformManager->SetInheritPosition( mTransformId, inherit );
355 * Retrieve the local orientation of the node, relative to its parent.
356 * @param[in] bufferIndex The buffer to read from.
357 * @return The local orientation.
359 const Quaternion& GetOrientation(BufferIndex bufferIndex) const
361 if( mTransformId != INVALID_TRANSFORM_ID )
363 return mOrientation.Get(0);
366 return Quaternion::IDENTITY;
370 * Retrieve the orientation of the node derived from the rotation of all its parents.
371 * @param[in] bufferIndex The buffer to read from.
372 * @return The world rotation.
374 const Quaternion& GetWorldOrientation( BufferIndex bufferIndex ) const
376 return mWorldOrientation.Get(0);
380 * Set whether the Node inherits orientation.
381 * @param[in] inherit True if the parent orientation is inherited.
383 void SetInheritOrientation(bool inherit)
385 if( mTransformId != INVALID_TRANSFORM_ID )
387 mTransformManager->SetInheritOrientation(mTransformId, inherit );
392 * Retrieve the local scale of the node, relative to its parent.
393 * @param[in] bufferIndex The buffer to read from.
394 * @return The local scale.
396 const Vector3& GetScale(BufferIndex bufferIndex) const
398 if( mTransformId != INVALID_TRANSFORM_ID )
400 return mScale.Get(0);
408 * Retrieve the scale of the node derived from the scale of all its parents.
409 * @param[in] bufferIndex The buffer to read from.
410 * @return The world scale.
412 const Vector3& GetWorldScale( BufferIndex bufferIndex ) const
414 return mWorldScale.Get(0);
418 * Set whether the Node inherits scale.
419 * @param inherit True if the Node inherits scale.
421 void SetInheritScale( bool inherit )
423 if( mTransformId != INVALID_TRANSFORM_ID )
425 mTransformManager->SetInheritScale(mTransformId, inherit );
430 * Retrieve the visibility of the node.
431 * @param[in] bufferIndex The buffer to read from.
432 * @return True if the node is visible.
434 bool IsVisible(BufferIndex bufferIndex) const
436 return mVisible[bufferIndex];
440 * Retrieve the opacity of the node.
441 * @param[in] bufferIndex The buffer to read from.
442 * @return The opacity.
444 float GetOpacity(BufferIndex bufferIndex) const
446 return mColor[bufferIndex].a;
450 * Retrieve the color of the node.
451 * @param[in] bufferIndex The buffer to read from.
454 const Vector4& GetColor(BufferIndex bufferIndex) const
456 return mColor[bufferIndex];
460 * Sets the color of the node derived from the color of all its parents.
461 * @param[in] color The world color.
462 * @param[in] updateBufferIndex The current update buffer index.
464 void SetWorldColor(const Vector4& color, BufferIndex updateBufferIndex)
466 mWorldColor.Set( updateBufferIndex, color );
470 * Sets the color of the node derived from the color of all its parents.
471 * This method should only be called when the parents world color is up-to-date.
472 * @pre The node has a parent.
473 * @param[in] updateBufferIndex The current update buffer index.
475 void InheritWorldColor( BufferIndex updateBufferIndex )
477 DALI_ASSERT_DEBUG(mParent != NULL);
480 if( mColorMode == USE_OWN_MULTIPLY_PARENT_ALPHA )
482 const Vector4& ownColor = mColor[updateBufferIndex];
483 mWorldColor.Set( updateBufferIndex, ownColor.r, ownColor.g, ownColor.b, ownColor.a * mParent->GetWorldColor(updateBufferIndex).a );
485 else if( mColorMode == USE_OWN_MULTIPLY_PARENT_COLOR )
487 mWorldColor.Set( updateBufferIndex, mParent->GetWorldColor(updateBufferIndex) * mColor[updateBufferIndex] );
489 else if( mColorMode == USE_PARENT_COLOR )
491 mWorldColor.Set( updateBufferIndex, mParent->GetWorldColor(updateBufferIndex) );
493 else // USE_OWN_COLOR
495 mWorldColor.Set( updateBufferIndex, mColor[updateBufferIndex] );
500 * Copies the previous inherited scale, if this changed in the previous frame.
501 * This method should be called instead of InheritWorldScale i.e. if the inherited scale
502 * does not need to be recalculated in the current frame.
503 * @param[in] updateBufferIndex The current update buffer index.
505 void CopyPreviousWorldColor( BufferIndex updateBufferIndex )
507 mWorldColor.CopyPrevious( updateBufferIndex );
511 * Retrieve the color of the node, possibly derived from the color
512 * of all its parents, depending on the value of mColorMode.
513 * @param[in] bufferIndex The buffer to read from.
514 * @return The world color.
516 const Vector4& GetWorldColor(BufferIndex bufferIndex) const
518 return mWorldColor[bufferIndex];
522 * Set the color mode. This specifies whether the Node uses its own color,
523 * or inherits its parent color.
524 * @param[in] colorMode The new color mode.
526 void SetColorMode(ColorMode colorMode)
528 mColorMode = colorMode;
530 SetDirtyFlag(ColorFlag);
534 * Retrieve the color mode.
535 * @return The color mode.
537 ColorMode GetColorMode() const
543 * Retrieve the size of the node.
544 * @param[in] bufferIndex The buffer to read from.
547 const Vector3& GetSize(BufferIndex bufferIndex) const
549 if( mTransformId != INVALID_TRANSFORM_ID )
554 return Vector3::ZERO;
558 * Retrieve the bounding sphere of the node
559 * @return A vector4 describing the bounding sphere. XYZ is the center and W is the radius
561 const Vector4& GetBoundingSphere() const
563 if( mTransformId != INVALID_TRANSFORM_ID )
565 return mTransformManager->GetBoundingSphere( mTransformId );
568 return Vector4::ZERO;
572 * Retrieve world matrix and size of the node
573 * @param[out] The local to world matrix of the node
574 * @param[out] size The current size of the node
576 void GetWorldMatrixAndSize( Matrix& worldMatrix, Vector3& size ) const
578 if( mTransformId != INVALID_TRANSFORM_ID )
580 mTransformManager->GetWorldMatrixAndSize( mTransformId, worldMatrix, size );
585 * Checks if local matrix has changed since last update
586 * @return true if local matrix has changed, false otherwise
588 bool IsLocalMatrixDirty() const
590 return (mTransformId != INVALID_TRANSFORM_ID) &&
591 (mTransformManager->IsLocalMatrixDirty( mTransformId ));
595 * Retrieve the cached world-matrix of a node.
596 * @param[in] bufferIndex The buffer to read from.
597 * @return The world-matrix.
599 const Matrix& GetWorldMatrix( BufferIndex bufferIndex ) const
601 return mWorldMatrix.Get(bufferIndex);
605 * Mark the node as exclusive to a single RenderTask.
606 * @param[in] renderTask The render-task, or NULL if the Node is not exclusive to a single RenderTask.
608 void SetExclusiveRenderTask( RenderTask* renderTask )
610 mExclusiveRenderTask = renderTask;
614 * Query whether the node is exclusive to a single RenderTask.
615 * @return The render-task, or NULL if the Node is not exclusive to a single RenderTask.
617 RenderTask* GetExclusiveRenderTask() const
619 return mExclusiveRenderTask;
623 * Set how the Node and its children should be drawn; see Dali::Actor::SetDrawMode() for more details.
624 * @param[in] drawMode The new draw-mode to use.
626 void SetDrawMode( const DrawMode::Type& drawMode )
628 mDrawMode = drawMode;
632 * Returns whether node is an overlay or not.
633 * @return True if node is an overlay, false otherwise.
635 DrawMode::Type GetDrawMode() const
641 * Returns the transform id of the node
642 * @return The transform component id of the node
644 TransformId GetTransformId() const
650 * Equality operator, checks for identity, not values.
653 bool operator==( const Node* rhs ) const
662 unsigned short GetDepth() const
668 * @brief Turns on or off being a batch parent for the node
669 * @param[in] enabled If true the node becomes a parent for batch of its children
671 void SetIsBatchParent( bool enabled );
674 * @brief Tells if the node is a batch parent
675 * @return True if node is a batch parent, false otherwise.
677 inline bool GetIsBatchParent()
679 return mIsBatchParent;
683 * Set the batch parent of a Node.
684 * @param[in] batchParentNode The new batch parent.
686 void SetBatchParent( Node* batchParentNode );
689 * Retrieve the batch parent of a Node.
690 * @return The batch parent node, or NULL if the Node has not been added to the scene-graph.
692 Node* GetBatchParent() const
699 * @copydoc UniformMap::Add
701 void AddUniformMapping( UniformPropertyMapping* map );
704 * @copydoc UniformMap::Remove
706 void RemoveUniformMapping( const std::string& uniformName );
709 * Prepare the node for rendering.
710 * This is called by the UpdateManager when an object is due to be rendered in the current frame.
711 * @param[in] updateBufferIndex The current update buffer index.
713 void PrepareRender( BufferIndex bufferIndex );
716 * Called by UpdateManager when the node is added.
717 * Creates a new transform component in the transform manager and initialize all the properties
718 * related to the transformation
719 * @param[in] transformManager A pointer to the trnasform manager (Owned by UpdateManager)
721 void CreateTransform( SceneGraph::TransformManager* transformManager );
726 * Set the parent of a Node.
727 * @param[in] parentNode the new parent.
729 void SetParent( Node& parentNode );
734 * Protected constructor; See also Node::New()
738 private: // from NodeDataProvider
741 * @copydoc NodeDataProvider::GetModelMatrix
743 virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const
745 return GetWorldMatrix( bufferId );
749 * @copydoc NodeDataProvider::GetRenderColor
751 virtual const Vector4& GetRenderColor( unsigned int bufferId ) const
753 return GetWorldColor( bufferId );
756 public: // From UniformMapDataProvider
758 * @copydoc UniformMapDataProvider::GetUniformMapChanged
760 virtual bool GetUniformMapChanged( BufferIndex bufferIndex ) const
762 return mUniformMapChanged[bufferIndex];
766 * @copydoc UniformMapDataProvider::GetUniformMap
768 virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const
770 return mCollectedUniformMap[bufferIndex];
779 Node& operator=(const Node& rhs);
782 * @copydoc Dali::Internal::SceneGraph::PropertyOwner::ResetDefaultProperties()
784 virtual void ResetDefaultProperties( BufferIndex updateBufferIndex );
787 * Recursive helper to disconnect a Node and its children.
788 * Disconnected Nodes have no parent or children.
789 * @param[in] updateBufferIndex The current update buffer index.
791 void RecursiveDisconnectFromSceneGraph( BufferIndex updateBufferIndex );
793 public: // Default properties
795 TransformManager* mTransformManager;
796 TransformId mTransformId;
797 TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
798 TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
799 TransformManagerPropertyVector3 mSize; ///< Size is provided for layouting
800 TransformManagerPropertyVector3 mPosition; ///< Local transform; distance between parent-origin & anchor-point
801 TransformManagerPropertyQuaternion mOrientation; ///< Local transform; rotation relative to parent node
802 TransformManagerPropertyVector3 mScale; ///< Local transform; scale relative to parent node
804 AnimatableProperty<bool> mVisible; ///< Visibility can be inherited from the Node hierachy
805 AnimatableProperty<Vector4> mColor; ///< Color can be inherited from the Node hierarchy
807 // Inherited properties; read-only from public API
809 TransformManagerVector3Input mWorldPosition; ///< Full inherited position
810 TransformManagerVector3Input mWorldScale;
811 TransformManagerQuaternionInput mWorldOrientation; ///< Full inherited orientation
812 TransformManagerMatrixInput mWorldMatrix; ///< Full inherited world matrix
813 InheritedColor mWorldColor; ///< Full inherited color
815 GeometryBatcher* mGeometryBatcher; ///< A pointer to an instance of geometry batcher
816 uint32_t mBatchIndex; ///< Batch 32bit handle, BATCH_NULL_HANDLE by default
817 bool mIsBatchParent:1; ///< Marks node as a batch parent
821 Node* mParent; ///< Pointer to parent node (a child is owned by its parent)
822 Node* mBatchParent; ///< Pointer to batch parent node
823 RenderTask* mExclusiveRenderTask; ///< Nodes can be marked as exclusive to a single RenderTask
825 RendererContainer mRenderer; ///< Container of renderers; not owned
827 NodeContainer mChildren; ///< Container of children; not owned
829 CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps of the node
830 unsigned int mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
831 unsigned int mRegenerateUniformMap : 2; ///< Indicate if the uniform map has to be regenerated this frame
833 // flags, compressed to bitfield
834 unsigned short mDepth: 12; ///< Depth in the hierarchy
835 int mDirtyFlags:8; ///< A composite set of flags for each of the Node properties
837 bool mIsRoot:1; ///< True if the node cannot have a parent
839 DrawMode::Type mDrawMode:2; ///< How the Node and its children should be drawn
840 ColorMode mColorMode:2; ///< Determines whether mWorldColor is inherited, 2 bits is enough
842 // Changes scope, should be at end of class
843 DALI_LOG_OBJECT_STRING_DECLARATION;
848 inline void SetInheritOrientationMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
850 typedef MessageValue1< Node, bool > LocalType;
852 // Reserve some memory inside the message queue
853 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
855 // Construct message in the message queue memory; note that delete should not be called on the return value
856 new (slot) LocalType( &node, &Node::SetInheritOrientation, inherit );
859 inline void SetParentOriginMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& origin )
861 typedef MessageValue1< Node, Vector3 > LocalType;
863 // Reserve some memory inside the message queue
864 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
866 // Construct message in the message queue memory; note that delete should not be called on the return value
867 new (slot) LocalType( &node, &Node::SetParentOrigin, origin );
870 inline void SetAnchorPointMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& anchor )
872 typedef MessageValue1< Node, Vector3 > LocalType;
874 // Reserve some memory inside the message queue
875 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
877 // Construct message in the message queue memory; note that delete should not be called on the return value
878 new (slot) LocalType( &node, &Node::SetAnchorPoint, anchor );
881 inline void SetInheritPositionMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
883 typedef MessageValue1< Node, bool > LocalType;
885 // Reserve some memory inside the message queue
886 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
888 // Construct message in the message queue memory; note that delete should not be called on the return value
889 new (slot) LocalType( &node, &Node::SetInheritPosition, inherit );
892 inline void SetInheritScaleMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
894 typedef MessageValue1< Node, bool > LocalType;
896 // Reserve some memory inside the message queue
897 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
899 // Construct message in the message queue memory; note that delete should not be called on the return value
900 new (slot) LocalType( &node, &Node::SetInheritScale, inherit );
903 inline void SetColorModeMessage( EventThreadServices& eventThreadServices, const Node& node, ColorMode colorMode )
905 typedef MessageValue1< Node, ColorMode > LocalType;
907 // Reserve some memory inside the message queue
908 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
910 // Construct message in the message queue memory; note that delete should not be called on the return value
911 new (slot) LocalType( &node, &Node::SetColorMode, colorMode );
914 inline void SetDrawModeMessage( EventThreadServices& eventThreadServices, const Node& node, DrawMode::Type drawMode )
916 typedef MessageValue1< Node, DrawMode::Type > LocalType;
918 // Reserve some memory inside the message queue
919 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
921 // Construct message in the message queue memory; note that delete should not be called on the return value
922 new (slot) LocalType( &node, &Node::SetDrawMode, drawMode );
925 inline void AddRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
927 typedef MessageValue1< Node, Renderer* > LocalType;
929 // Reserve some memory inside the message queue
930 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
932 // Construct message in the message queue memory; note that delete should not be called on the return value
933 new (slot) LocalType( &node, &Node::AddRenderer, renderer );
936 inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
938 typedef MessageValue1< Node, Renderer* > LocalType;
940 // Reserve some memory inside the message queue
941 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
943 // Construct message in the message queue memory; note that delete should not be called on the return value
944 new (slot) LocalType( &node, &Node::RemoveRenderer, renderer );
947 inline void SetIsBatchParentMessage( EventThreadServices& eventThreadServices, const Node& node, bool isBatchParent )
949 typedef MessageValue1< Node, bool > LocalType;
951 // Reserve some memory inside the message queue
952 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
954 // Construct message in the message queue memory; note that delete should not be called on the return value
955 new (slot) LocalType( &node, &Node::SetIsBatchParent, isBatchParent );
959 } // namespace SceneGraph
961 } // namespace Internal
965 #endif // __DALI_INTERNAL_SCENE_GRAPH_NODE_H_