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 );
718 unsigned short GetDepth() const
724 * @brief Turns on or off being a batch parent for the node
725 * @param[in] enabled If true the node becomes a parent for batch of its children
727 void SetIsBatchParent( bool enabled );
730 * @brief Tells if the node is a batch parent
731 * @return True if node is a batch parent, false otherwise.
733 inline bool GetIsBatchParent()
735 return mIsBatchParent;
739 * Set the batch parent of a Node.
740 * @param[in] batchParentNode The new batch parent.
742 void SetBatchParent( Node* batchParentNode );
745 * Retrieve the batch parent of a Node.
746 * @return The batch parent node, or NULL if the Node has not been added to the scene-graph.
748 Node* GetBatchParent() const
755 * @copydoc UniformMap::Add
757 void AddUniformMapping( UniformPropertyMapping* map );
760 * @copydoc UniformMap::Remove
762 void RemoveUniformMapping( const std::string& uniformName );
765 * Prepare the node for rendering.
766 * This is called by the UpdateManager when an object is due to be rendered in the current frame.
767 * @param[in] updateBufferIndex The current update buffer index.
769 void PrepareRender( BufferIndex bufferIndex );
772 * Called by UpdateManager when the node is added.
773 * Creates a new transform component in the transform manager and initialize all the properties
774 * related to the transformation
775 * @param[in] transformManager A pointer to the trnasform manager (Owned by UpdateManager)
777 void CreateTransform( SceneGraph::TransformManager* transformManager );
782 * Set the parent of a Node.
783 * @param[in] parentNode the new parent.
785 void SetParent( Node& parentNode );
790 * Protected constructor; See also Node::New()
794 private: // from NodeDataProvider
797 * @copydoc NodeDataProvider::GetModelMatrix
799 virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const
801 return GetWorldMatrix( bufferId );
805 * @copydoc NodeDataProvider::GetRenderColor
807 virtual const Vector4& GetRenderColor( unsigned int bufferId ) const
809 return GetWorldColor( bufferId );
812 public: // From UniformMapDataProvider
814 * @copydoc UniformMapDataProvider::GetUniformMapChanged
816 virtual bool GetUniformMapChanged( BufferIndex bufferIndex ) const
818 return mUniformMapChanged[bufferIndex];
822 * @copydoc UniformMapDataProvider::GetUniformMap
824 virtual const CollectedUniformMap& GetUniformMap( BufferIndex bufferIndex ) const
826 return mCollectedUniformMap[bufferIndex];
835 Node& operator=(const Node& rhs);
838 * @copydoc Dali::Internal::SceneGraph::PropertyOwner::ResetDefaultProperties()
840 virtual void ResetDefaultProperties( BufferIndex updateBufferIndex );
843 * Recursive helper to disconnect a Node and its children.
844 * Disconnected Nodes have no parent or children.
845 * @param[in] updateBufferIndex The current update buffer index.
847 void RecursiveDisconnectFromSceneGraph( BufferIndex updateBufferIndex );
849 public: // Default properties
851 TransformManager* mTransformManager;
852 TransformId mTransformId;
853 TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
854 TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
855 TransformManagerPropertyVector3 mSize; ///< Size is provided for layouting
856 TransformManagerPropertyVector3 mPosition; ///< Local transform; distance between parent-origin & anchor-point
857 TransformManagerPropertyQuaternion mOrientation; ///< Local transform; rotation relative to parent node
858 TransformManagerPropertyVector3 mScale; ///< Local transform; scale relative to parent node
860 AnimatableProperty<bool> mVisible; ///< Visibility can be inherited from the Node hierachy
861 AnimatableProperty<Vector4> mColor; ///< Color can be inherited from the Node hierarchy
863 // Inherited properties; read-only from public API
865 TransformManagerVector3Input mWorldPosition; ///< Full inherited position
866 TransformManagerVector3Input mWorldScale;
867 TransformManagerQuaternionInput mWorldOrientation; ///< Full inherited orientation
868 TransformManagerMatrixInput mWorldMatrix; ///< Full inherited world matrix
869 InheritedColor mWorldColor; ///< Full inherited color
871 GeometryBatcher* mGeometryBatcher; ///< A pointer to an instance of geometry batcher
872 uint32_t mBatchIndex; ///< Batch 32bit handle, BATCH_NULL_HANDLE by default
873 uint32_t mClippingSortModifier; ///< Contains bit-packed clipping information for quick access when sorting
875 bool mIsBatchParent:1; ///< Marks node as a batch parent
879 Node* mParent; ///< Pointer to parent node (a child is owned by its parent)
880 Node* mBatchParent; ///< Pointer to batch parent node
881 RenderTask* mExclusiveRenderTask; ///< Nodes can be marked as exclusive to a single RenderTask
883 RendererContainer mRenderer; ///< Container of renderers; not owned
885 NodeContainer mChildren; ///< Container of children; not owned
887 CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps of the node
888 unsigned int mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
889 uint32_t mClippingDepth; ///< The number of clipping nodes deep this node is
890 unsigned int mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
892 // flags, compressed to bitfield
893 unsigned short mDepth:12; ///< Depth in the hierarchy
894 int mDirtyFlags:8; ///< A composite set of flags for each of the Node properties
895 DrawMode::Type mDrawMode:2; ///< How the Node and its children should be drawn
896 ColorMode mColorMode:2; ///< Determines whether mWorldColor is inherited, 2 bits is enough
897 ClippingMode::Type mClippingMode:2; ///< The clipping mode of this node
898 bool mIsRoot:1; ///< True if the node cannot have a parent
900 // Changes scope, should be at end of class
901 DALI_LOG_OBJECT_STRING_DECLARATION;
906 inline void SetInheritOrientationMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
908 typedef MessageValue1< Node, bool > LocalType;
910 // Reserve some memory inside the message queue
911 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
913 // Construct message in the message queue memory; note that delete should not be called on the return value
914 new (slot) LocalType( &node, &Node::SetInheritOrientation, inherit );
917 inline void SetParentOriginMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& origin )
919 typedef MessageValue1< Node, Vector3 > LocalType;
921 // Reserve some memory inside the message queue
922 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
924 // Construct message in the message queue memory; note that delete should not be called on the return value
925 new (slot) LocalType( &node, &Node::SetParentOrigin, origin );
928 inline void SetAnchorPointMessage( EventThreadServices& eventThreadServices, const Node& node, const Vector3& anchor )
930 typedef MessageValue1< Node, Vector3 > LocalType;
932 // Reserve some memory inside the message queue
933 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
935 // Construct message in the message queue memory; note that delete should not be called on the return value
936 new (slot) LocalType( &node, &Node::SetAnchorPoint, anchor );
939 inline void SetInheritPositionMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
941 typedef MessageValue1< Node, bool > LocalType;
943 // Reserve some memory inside the message queue
944 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
946 // Construct message in the message queue memory; note that delete should not be called on the return value
947 new (slot) LocalType( &node, &Node::SetInheritPosition, inherit );
950 inline void SetInheritScaleMessage( EventThreadServices& eventThreadServices, const Node& node, bool inherit )
952 typedef MessageValue1< Node, bool > LocalType;
954 // Reserve some memory inside the message queue
955 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
957 // Construct message in the message queue memory; note that delete should not be called on the return value
958 new (slot) LocalType( &node, &Node::SetInheritScale, inherit );
961 inline void SetColorModeMessage( EventThreadServices& eventThreadServices, const Node& node, ColorMode colorMode )
963 typedef MessageValue1< Node, ColorMode > LocalType;
965 // Reserve some memory inside the message queue
966 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
968 // Construct message in the message queue memory; note that delete should not be called on the return value
969 new (slot) LocalType( &node, &Node::SetColorMode, colorMode );
972 inline void SetDrawModeMessage( EventThreadServices& eventThreadServices, const Node& node, DrawMode::Type drawMode )
974 typedef MessageValue1< Node, DrawMode::Type > LocalType;
976 // Reserve some memory inside the message queue
977 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
979 // Construct message in the message queue memory; note that delete should not be called on the return value
980 new (slot) LocalType( &node, &Node::SetDrawMode, drawMode );
983 inline void AddRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
985 typedef MessageValue1< Node, Renderer* > LocalType;
987 // Reserve some memory inside the message queue
988 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
990 // Construct message in the message queue memory; note that delete should not be called on the return value
991 new (slot) LocalType( &node, &Node::AddRenderer, renderer );
994 inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer )
996 typedef MessageValue1< Node, Renderer* > LocalType;
998 // Reserve some memory inside the message queue
999 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1001 // Construct message in the message queue memory; note that delete should not be called on the return value
1002 new (slot) LocalType( &node, &Node::RemoveRenderer, renderer );
1005 inline void SetIsBatchParentMessage( EventThreadServices& eventThreadServices, const Node& node, bool isBatchParent )
1007 typedef MessageValue1< Node, bool > LocalType;
1009 // Reserve some memory inside the message queue
1010 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1012 // Construct message in the message queue memory; note that delete should not be called on the return value
1013 new (slot) LocalType( &node, &Node::SetIsBatchParent, isBatchParent );
1016 inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, const Node& node, ClippingMode::Type clippingMode )
1018 typedef MessageValue1< Node, ClippingMode::Type > LocalType;
1020 // Reserve some memory inside the message queue
1021 unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
1023 // Construct message in the message queue memory; note that delete should not be called on the return value
1024 new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode );
1028 } // namespace SceneGraph
1030 } // namespace Internal
1034 #endif // DALI_INTERNAL_SCENE_GRAPH_NODE_H