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 > {};
51 template <> struct ParameterType< ClippingMode::Type > : public BasicType< ClippingMode::Type > {};
60 class GeometryBatcher;
63 * Flag whether property has changed, during the Update phase.
65 enum NodePropertyFlags
68 TransformFlag = 0x001,
73 SortModifierFlag = 0x020,
74 ChildDeletedFlag = 0x040,
77 static const int AllFlags = ( ChildDeletedFlag << 1 ) - 1; // all the flags
80 * Size is not inherited. VisibleFlag is inherited
82 static const int InheritedDirtyFlags = TransformFlag | VisibleFlag | ColorFlag | OverlayFlag;
84 // Flags which require the scene renderable lists to be updated
85 static const int RenderableUpdateFlags = TransformFlag | SortModifierFlag | ChildDeletedFlag;
88 * Node is the base class for all nodes in the Scene Graph.
90 * Each node provides a transformation which applies to the node and
91 * its children. Node data is double-buffered. This allows an update
92 * thread to modify node data, without interferring with another
93 * thread reading the values from the previous update traversal.
95 class Node : public PropertyOwner, public NodeDataProvider
100 static const PositionInheritanceMode DEFAULT_POSITION_INHERITANCE_MODE;
101 static const ColorMode DEFAULT_COLOR_MODE;
106 * Construct a new Node.
116 * Overriden delete operator
117 * Deletes the node from its global memory pool
119 void operator delete( void* ptr );
122 * Called during UpdateManager::DestroyNode shortly before Node is destroyed.
129 * Query whether the node is a layer.
130 * @return True if the node is a layer.
134 return (GetLayer() != NULL);
138 * Convert a node to a layer.
139 * @return A pointer to the layer, or NULL.
141 virtual Layer* GetLayer()
147 * This method sets clipping information on the node based on its hierarchy in the scene-graph.
148 * A value is calculated that can be used during sorting to increase sort speed.
149 * @param[in] clippingId The Clipping ID of the node to set
150 * @param[in] clippingDepth The Clipping Depth of the node to set
152 void SetClippingInformation( const uint32_t clippingId, const uint32_t clippingDepth )
154 // We only set up the sort value if we have a clipping depth, IE. At least 1 clipping node has been hit.
155 // If not, if we traverse down a clipping tree and back up, and there is another
156 // node on the parent, this will have a non-zero clipping ID that must be ignored
157 if( DALI_LIKELY( clippingDepth > 0u ) )
159 mClippingDepth = clippingDepth;
161 // Calculate the sort value here on write, as when read (during sort) it may be accessed several times.
162 // The items must be sorted by Clipping ID first (so the ID is kept in the most-significant bits).
163 // For the same ID, the clipping nodes must be first, so we negate the
164 // clipping enabled flag and set it as the least significant bit.
165 mClippingSortModifier = ( clippingId << 1u ) | ( mClippingMode == ClippingMode::DISABLED ? 1u : 0u );
170 * Gets the Clipping ID for this node.
171 * @return The Clipping ID for this node.
173 uint32_t GetClippingId() const
175 return mClippingSortModifier >> 1u;
179 * Gets the Clipping Depth for this node.
180 * @return The Clipping Depth for this node.
182 uint32_t GetClippingDepth() const
184 return mClippingDepth;
188 * Sets the clipping mode for this node.
189 * @param[in] clippingMode The ClippingMode to set
191 void SetClippingMode( const ClippingMode::Type clippingMode )
193 mClippingMode = clippingMode;
197 * Gets the Clipping Mode for this node.
198 * @return The ClippingMode of this node
200 ClippingMode::Type GetClippingMode() const
202 return mClippingMode;
206 * Add a renderer to the node
207 * @param[in] renderer The renderer added to the node
209 void AddRenderer( Renderer* renderer );
212 * Remove a renderer from the node
213 * @param[in] renderer The renderer to be removed
215 void RemoveRenderer( Renderer* renderer );
218 * Get the renderer at the given index
221 Renderer* GetRendererAt( unsigned int index ) const
223 return mRenderer[index];
227 * Retrieve the number of renderers for the node
229 unsigned int GetRendererCount()
231 return mRenderer.Size();
234 // Containment methods
237 * Query whether a node is the root node. Root nodes cannot have a parent node.
238 * A node becomes a root node, when it is installed by UpdateManager.
239 * @return True if the node is a root node.
247 * Set whether a node is the root node. Root nodes cannot have a parent node.
248 * This method should only be called by UpdateManager.
249 * @pre When isRoot is true, the node must not have a parent.
250 * @param[in] isRoot Whether the node is now a root node.
252 void SetRoot(bool isRoot);
255 * Retrieve the parent of a Node.
256 * @return The parent node, or NULL if the Node has not been added to the scene-graph.
264 * Retrieve the parent of a Node.
265 * @return The parent node, or NULL if the Node has not been added to the scene-graph.
267 const Node* GetParent() const
273 * Connect a node to the scene-graph.
274 * @pre A node cannot be added to itself.
275 * @pre The parent node is connected to the scene-graph.
276 * @pre The childNode does not already have a parent.
277 * @pre The childNode is not a root node.
278 * @param[in] childNode The child to add.
280 void ConnectChild( Node* childNode );
283 * Disconnect a child (& its children) from the scene-graph.
284 * @pre childNode is a child of this Node.
285 * @param[in] updateBufferIndex The current update buffer index.
286 * @param[in] childNode The node to disconnect.
288 void DisconnectChild( BufferIndex updateBufferIndex, Node& childNode );
291 * Retrieve the children a Node.
292 * @return The container of children.
294 const NodeContainer& GetChildren() const
300 * Retrieve the children a Node.
301 * @return The container of children.
303 NodeContainer& GetChildren()
311 * Flag that one of the node values has changed in the current frame.
312 * @param[in] flag The flag to set.
314 void SetDirtyFlag(NodePropertyFlags flag)
320 * Flag that all of the node values are dirty.
322 void SetAllDirtyFlags()
324 mDirtyFlags = AllFlags;
328 * Query whether a node is dirty.
329 * @return The dirty flags
331 int GetDirtyFlags() const;
334 * Query whether a node is clean.
335 * @return True if the node is clean.
339 return ( NothingFlag == GetDirtyFlags() );
343 * Retrieve the parent-origin of the node.
344 * @return The parent-origin.
346 const Vector3& GetParentOrigin() const
348 return mParentOrigin.Get(0);
352 * Sets both the local & base parent-origins of the node.
353 * @param[in] origin The new local & base parent-origins.
355 void SetParentOrigin(const Vector3& origin)
357 mParentOrigin.Set(0,origin );
361 * Retrieve the anchor-point of the node.
362 * @return The anchor-point.
364 const Vector3& GetAnchorPoint() const
366 return mAnchorPoint.Get(0);
370 * Sets both the local & base anchor-points of the node.
371 * @param[in] anchor The new local & base anchor-points.
373 void SetAnchorPoint(const Vector3& anchor)
375 mAnchorPoint.Set(0, anchor );
379 * Retrieve the local position of the node, relative to its parent.
380 * @param[in] bufferIndex The buffer to read from.
381 * @return The local position.
383 const Vector3& GetPosition(BufferIndex bufferIndex) const
385 if( mTransformId != INVALID_TRANSFORM_ID )
387 return mPosition.Get(bufferIndex);
390 return Vector3::ZERO;
394 * Retrieve the position of the node derived from the position of all its parents.
395 * @return The world position.
397 const Vector3& GetWorldPosition( BufferIndex bufferIndex ) const
399 return mWorldPosition.Get(bufferIndex);
403 * Set whether the Node inherits position.
404 * @param[in] inherit True if the parent position is inherited.
406 void SetInheritPosition(bool inherit)
408 if( mTransformId != INVALID_TRANSFORM_ID )
410 mTransformManager->SetInheritPosition( mTransformId, inherit );
415 * Retrieve the local orientation of the node, relative to its parent.
416 * @param[in] bufferIndex The buffer to read from.
417 * @return The local orientation.
419 const Quaternion& GetOrientation(BufferIndex bufferIndex) const
421 if( mTransformId != INVALID_TRANSFORM_ID )
423 return mOrientation.Get(0);
426 return Quaternion::IDENTITY;
430 * Retrieve the orientation of the node derived from the rotation of all its parents.
431 * @param[in] bufferIndex The buffer to read from.
432 * @return The world rotation.
434 const Quaternion& GetWorldOrientation( BufferIndex bufferIndex ) const
436 return mWorldOrientation.Get(0);
440 * Set whether the Node inherits orientation.
441 * @param[in] inherit True if the parent orientation is inherited.
443 void SetInheritOrientation(bool inherit)
445 if( mTransformId != INVALID_TRANSFORM_ID )
447 mTransformManager->SetInheritOrientation(mTransformId, inherit );
452 * Retrieve the local scale of the node, relative to its parent.
453 * @param[in] bufferIndex The buffer to read from.
454 * @return The local scale.
456 const Vector3& GetScale(BufferIndex bufferIndex) const
458 if( mTransformId != INVALID_TRANSFORM_ID )
460 return mScale.Get(0);
468 * Retrieve the scale of the node derived from the scale of all its parents.
469 * @param[in] bufferIndex The buffer to read from.
470 * @return The world scale.
472 const Vector3& GetWorldScale( BufferIndex bufferIndex ) const
474 return mWorldScale.Get(0);
478 * Set whether the Node inherits scale.
479 * @param inherit True if the Node inherits scale.
481 void SetInheritScale( bool inherit )
483 if( mTransformId != INVALID_TRANSFORM_ID )
485 mTransformManager->SetInheritScale(mTransformId, inherit );
490 * Retrieve the visibility of the node.
491 * @param[in] bufferIndex The buffer to read from.
492 * @return True if the node is visible.
494 bool IsVisible(BufferIndex bufferIndex) const
496 return mVisible[bufferIndex];
500 * Retrieve the opacity of the node.
501 * @param[in] bufferIndex The buffer to read from.
502 * @return The opacity.
504 float GetOpacity(BufferIndex bufferIndex) const
506 return mColor[bufferIndex].a;
510 * Retrieve the color of the node.
511 * @param[in] bufferIndex The buffer to read from.
514 const Vector4& GetColor(BufferIndex bufferIndex) const
516 return mColor[bufferIndex];
520 * Sets the color of the node derived from the color of all its parents.
521 * @param[in] color The world color.
522 * @param[in] updateBufferIndex The current update buffer index.
524 void SetWorldColor(const Vector4& color, BufferIndex updateBufferIndex)
526 mWorldColor.Set( updateBufferIndex, color );
530 * Sets the color of the node derived from the color of all its parents.
531 * This method should only be called when the parents world color is up-to-date.
532 * @pre The node has a parent.
533 * @param[in] updateBufferIndex The current update buffer index.
535 void InheritWorldColor( BufferIndex updateBufferIndex )
537 DALI_ASSERT_DEBUG(mParent != NULL);
540 if( mColorMode == USE_OWN_MULTIPLY_PARENT_ALPHA )
542 const Vector4& ownColor = mColor[updateBufferIndex];
543 mWorldColor.Set( updateBufferIndex, ownColor.r, ownColor.g, ownColor.b, ownColor.a * mParent->GetWorldColor(updateBufferIndex).a );
545 else if( mColorMode == USE_OWN_MULTIPLY_PARENT_COLOR )
547 mWorldColor.Set( updateBufferIndex, mParent->GetWorldColor(updateBufferIndex) * mColor[updateBufferIndex] );
549 else if( mColorMode == USE_PARENT_COLOR )
551 mWorldColor.Set( updateBufferIndex, mParent->GetWorldColor(updateBufferIndex) );
553 else // USE_OWN_COLOR
555 mWorldColor.Set( updateBufferIndex, mColor[updateBufferIndex] );
560 * Copies the previous inherited scale, if this changed in the previous frame.
561 * This method should be called instead of InheritWorldScale i.e. if the inherited scale
562 * does not need to be recalculated in the current frame.
563 * @param[in] updateBufferIndex The current update buffer index.
565 void CopyPreviousWorldColor( BufferIndex updateBufferIndex )
567 mWorldColor.CopyPrevious( updateBufferIndex );
571 * Retrieve the color of the node, possibly derived from the color
572 * of all its parents, depending on the value of mColorMode.
573 * @param[in] bufferIndex The buffer to read from.
574 * @return The world color.
576 const Vector4& GetWorldColor(BufferIndex bufferIndex) const
578 return mWorldColor[bufferIndex];
582 * Set the color mode. This specifies whether the Node uses its own color,
583 * or inherits its parent color.
584 * @param[in] colorMode The new color mode.
586 void SetColorMode(ColorMode colorMode)
588 mColorMode = colorMode;
590 SetDirtyFlag(ColorFlag);
594 * Retrieve the color mode.
595 * @return The color mode.
597 ColorMode GetColorMode() const
603 * Retrieve the size of the node.
604 * @param[in] bufferIndex The buffer to read from.
607 const Vector3& GetSize(BufferIndex bufferIndex) const
609 if( mTransformId != INVALID_TRANSFORM_ID )
614 return Vector3::ZERO;
618 * Retrieve the bounding sphere of the node
619 * @return A vector4 describing the bounding sphere. XYZ is the center and W is the radius
621 const Vector4& GetBoundingSphere() const
623 if( mTransformId != INVALID_TRANSFORM_ID )
625 return mTransformManager->GetBoundingSphere( mTransformId );
628 return Vector4::ZERO;
632 * Retrieve world matrix and size of the node
633 * @param[out] The local to world matrix of the node
634 * @param[out] size The current size of the node
636 void GetWorldMatrixAndSize( Matrix& worldMatrix, Vector3& size ) const
638 if( mTransformId != INVALID_TRANSFORM_ID )
640 mTransformManager->GetWorldMatrixAndSize( mTransformId, worldMatrix, size );
645 * Checks if local matrix has changed since last update
646 * @return true if local matrix has changed, false otherwise
648 bool IsLocalMatrixDirty() const
650 return (mTransformId != INVALID_TRANSFORM_ID) &&
651 (mTransformManager->IsLocalMatrixDirty( mTransformId ));
655 * Retrieve the cached world-matrix of a node.
656 * @param[in] bufferIndex The buffer to read from.
657 * @return The world-matrix.
659 const Matrix& GetWorldMatrix( BufferIndex bufferIndex ) const
661 return mWorldMatrix.Get(bufferIndex);
665 * Mark the node as exclusive to a single RenderTask.
666 * @param[in] renderTask The render-task, or NULL if the Node is not exclusive to a single RenderTask.
668 void SetExclusiveRenderTask( RenderTask* renderTask )
670 mExclusiveRenderTask = renderTask;
674 * Query whether the node is exclusive to a single RenderTask.
675 * @return The render-task, or NULL if the Node is not exclusive to a single RenderTask.
677 RenderTask* GetExclusiveRenderTask() const
679 return mExclusiveRenderTask;
683 * Set how the Node and its children should be drawn; see Dali::Actor::SetDrawMode() for more details.
684 * @param[in] drawMode The new draw-mode to use.
686 void SetDrawMode( const DrawMode::Type& drawMode )
688 mDrawMode = drawMode;
692 * Returns whether node is an overlay or not.
693 * @return True if node is an overlay, false otherwise.
695 DrawMode::Type GetDrawMode() const
701 * Returns the transform id of the node
702 * @return The transform component id of the node
704 TransformId GetTransformId() const
710 * Equality operator, checks for identity, not values.
713 bool operator==( const Node* rhs ) const
715 return ( this == rhs );
719 * @brief Turns on or off being a batch parent for the node
720 * @param[in] enabled If true the node becomes a parent for batch of its children
722 void SetIsBatchParent( bool enabled );
725 * @brief Sets the sibling order of the node
726 * @param[in] order The new order
728 void SetDepthIndex( unsigned int depthIndex ){ mDepthIndex = depthIndex; }
731 * @brief Get the depth index of the node
732 * @return Current depth index
734 unsigned int GetDepthIndex(){ return mDepthIndex; }
737 * @brief Tells if the node is a batch parent
738 * @return True if node is a batch parent, false otherwise.
740 inline bool GetIsBatchParent()
742 return mIsBatchParent;
746 * Set the batch parent of a Node.
747 * @param[in] batchParentNode The new batch parent.
749 void SetBatchParent( Node* batchParentNode );
752 * Retrieve the batch parent of a Node.
753 * @return The batch parent node, or NULL if the Node has not been added to the scene-graph.
755 Node* GetBatchParent() const
762 * @copydoc UniformMap::Add
764 void AddUniformMapping( UniformPropertyMapping* map );
767 * @copydoc UniformMap::Remove
769 void RemoveUniformMapping( const std::string& uniformName );
772 * Prepare the node for rendering.
773 * This is called by the UpdateManager when an object is due to be rendered in the current frame.
774 * @param[in] updateBufferIndex The current update buffer index.
776 void PrepareRender( BufferIndex bufferIndex );
779 * Called by UpdateManager when the node is added.
780 * Creates a new transform component in the transform manager and initialize all the properties
781 * related to the transformation
782 * @param[in] transformManager A pointer to the trnasform manager (Owned by UpdateManager)
784 void CreateTransform( SceneGraph::TransformManager* transformManager );
789 * Set the parent of a Node.
790 * @param[in] parentNode the new parent.
792 void SetParent( Node& parentNode );
797 * Protected constructor; See also Node::New()
801 private: // from NodeDataProvider
804 * @copydoc NodeDataProvider::GetModelMatrix
806 virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const
808 return GetWorldMatrix( bufferId );
812 * @copydoc NodeDataProvider::GetRenderColor
814 virtual const Vector4& GetRenderColor( unsigned int bufferId ) const
816 return GetWorldColor( bufferId );
819 public: // From UniformMapDataProvider
821 * @copydoc UniformMapDataProvider::GetUniformMapChanged
823 virtual bool GetUniformMapChanged( BufferIndex bufferIndex ) const
825 return mUniformMapChanged[bufferIndex];
829 * @copydoc UniformMapDataProvider::GetUniformMap
831 virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const
833 return mCollectedUniformMap[bufferIndex];
842 Node& operator=(const Node& rhs);
845 * @copydoc Dali::Internal::SceneGraph::PropertyOwner::ResetDefaultProperties()
847 virtual void ResetDefaultProperties( BufferIndex updateBufferIndex );
850 * Recursive helper to disconnect a Node and its children.
851 * Disconnected Nodes have no parent or children.
852 * @param[in] updateBufferIndex The current update buffer index.
854 void RecursiveDisconnectFromSceneGraph( BufferIndex updateBufferIndex );
856 public: // Default properties
858 TransformManager* mTransformManager;
859 TransformId mTransformId;
860 TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
861 TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
862 TransformManagerPropertyVector3 mSize; ///< Size is provided for layouting
863 TransformManagerPropertyVector3 mPosition; ///< Local transform; distance between parent-origin & anchor-point
864 TransformManagerPropertyQuaternion mOrientation; ///< Local transform; rotation relative to parent node
865 TransformManagerPropertyVector3 mScale; ///< Local transform; scale relative to parent node
867 AnimatableProperty<bool> mVisible; ///< Visibility can be inherited from the Node hierachy
868 AnimatableProperty<Vector4> mColor; ///< Color can be inherited from the Node hierarchy
870 // Inherited properties; read-only from public API
872 TransformManagerVector3Input mWorldPosition; ///< Full inherited position
873 TransformManagerVector3Input mWorldScale;
874 TransformManagerQuaternionInput mWorldOrientation; ///< Full inherited orientation
875 TransformManagerMatrixInput mWorldMatrix; ///< Full inherited world matrix
876 InheritedColor mWorldColor; ///< Full inherited color
878 GeometryBatcher* mGeometryBatcher; ///< A pointer to an instance of geometry batcher
879 uint32_t mBatchIndex; ///< Batch 32bit handle, BATCH_NULL_HANDLE by default
880 uint32_t mClippingSortModifier; ///< Contains bit-packed clipping information for quick access when sorting
882 bool mIsBatchParent:1; ///< Marks node as a batch parent
886 Node* mParent; ///< Pointer to parent node (a child is owned by its parent)
887 Node* mBatchParent; ///< Pointer to batch parent node
888 RenderTask* mExclusiveRenderTask; ///< Nodes can be marked as exclusive to a single RenderTask
890 RendererContainer mRenderer; ///< Container of renderers; not owned
892 NodeContainer mChildren; ///< Container of children; not owned
894 CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps of the node
895 unsigned int mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
896 uint32_t mClippingDepth; ///< The number of clipping nodes deep this node is
898 uint32_t mDepthIndex; ///< Depth index of the node
900 // flags, compressed to bitfield
901 unsigned int mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
902 int mDirtyFlags:8; ///< A composite set of flags for each of the Node properties
903 DrawMode::Type mDrawMode:2; ///< How the Node and its children should be drawn
904 ColorMode mColorMode:2; ///< Determines whether mWorldColor is inherited, 2 bits is enough
905 ClippingMode::Type mClippingMode:2; ///< The clipping mode of this node
906 bool mIsRoot:1; ///< True if the node cannot have a parent
908 // Changes scope, should be at end of class
909 DALI_LOG_OBJECT_STRING_DECLARATION;
914 inline void SetInheritOrientationMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
916 typedef MessageValue1< Node, bool > 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::SetInheritOrientation, inherit );
925 inline void SetParentOriginMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& origin )
927 typedef MessageValue1< Node, Vector3 > 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::SetParentOrigin, origin );
936 inline void SetAnchorPointMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& anchor )
938 typedef MessageValue1< Node, Vector3 > 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::SetAnchorPoint, anchor );
947 inline void SetInheritPositionMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
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::SetInheritPosition, inherit );
958 inline void SetInheritScaleMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
960 typedef MessageValue1< Node, bool > LocalType;
962 // Reserve some memory inside the message queue
963 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
965 // Construct message in the message queue memory; note that delete should not be called on the return value
966 new (slot) LocalType( &node, &Node::SetInheritScale, inherit );
969 inline void SetColorModeMessage( EventThreadServices& eventThreadServices, const Node& node, ColorMode colorMode )
971 typedef MessageValue1< Node, ColorMode > LocalType;
973 // Reserve some memory inside the message queue
974 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
976 // Construct message in the message queue memory; note that delete should not be called on the return value
977 new (slot) LocalType( &node, &Node::SetColorMode, colorMode );
980 inline void SetDrawModeMessage( EventThreadServices& eventThreadServices, const Node& node, DrawMode::Type drawMode )
982 typedef MessageValue1< Node, DrawMode::Type > LocalType;
984 // Reserve some memory inside the message queue
985 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
987 // Construct message in the message queue memory; note that delete should not be called on the return value
988 new (slot) LocalType( &node, &Node::SetDrawMode, drawMode );
991 inline void AddRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
993 typedef MessageValue1< Node, Renderer* > LocalType;
995 // Reserve some memory inside the message queue
996 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
998 // Construct message in the message queue memory; note that delete should not be called on the return value
999 new (slot) LocalType( &node, &Node::AddRenderer, renderer );
1002 inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
1004 typedef MessageValue1< Node, Renderer* > LocalType;
1006 // Reserve some memory inside the message queue
1007 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1009 // Construct message in the message queue memory; note that delete should not be called on the return value
1010 new (slot) LocalType( &node, &Node::RemoveRenderer, renderer );
1013 inline void SetIsBatchParentMessage( EventThreadServices& eventThreadServices, const Node& node, bool isBatchParent )
1015 typedef MessageValue1< Node, bool > LocalType;
1017 // Reserve some memory inside the message queue
1018 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1020 // Construct message in the message queue memory; note that delete should not be called on the return value
1021 new (slot) LocalType( &node, &Node::SetIsBatchParent, isBatchParent );
1024 inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, unsigned int depthIndex )
1026 typedef MessageValue1< Node, unsigned int > LocalType;
1028 // Reserve some memory inside the message queue
1029 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1031 // Construct message in the message queue memory; note that delete should not be called on the return value
1032 new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex );
1035 inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, const Node& node, ClippingMode::Type clippingMode )
1037 typedef MessageValue1< Node, ClippingMode::Type > LocalType;
1039 // Reserve some memory inside the message queue
1040 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1042 // Construct message in the message queue memory; note that delete should not be called on the return value
1043 new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode );
1047 } // namespace SceneGraph
1049 } // namespace Internal
1053 #endif // DALI_INTERNAL_SCENE_GRAPH_NODE_H