}
}
-void Actor::ConnectToStage( unsigned int parentDepth, int index )
+void Actor::ConnectToStage( unsigned int parentDepth )
{
- // This container is used instead of walking the Actor hierachy.
- // It protects us when the Actor hierachy is modified during OnStageConnectionExternal callbacks.
+ // This container is used instead of walking the Actor hierarchy.
+ // It protects us when the Actor hierarchy is modified during OnStageConnectionExternal callbacks.
ActorContainer connectionList;
-
- // This stage is atomic i.e. not interrupted by user callbacks
- RecursiveConnectToStage( connectionList, parentDepth+1, index );
+ // This stage is atomic i.e. not interrupted by user callbacks.
+ RecursiveConnectToStage( connectionList, parentDepth + 1 );
// Notify applications about the newly connected actors.
const ActorIter endIter = connectionList.end();
RelayoutRequest();
}
-void Actor::RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth, int index )
+void Actor::RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth )
{
DALI_ASSERT_ALWAYS( !OnStage() );
mIsOnStage = true;
mDepth = depth;
- ConnectToSceneGraph( index );
+ ConnectToSceneGraph();
// Notification for internal derived classes
OnStageConnectionInternal();
* This method is called when the Actor is connected to the Stage.
* The parent must have added its Node to the scene-graph.
* The child must connect its Node to the parent's Node.
- * This is resursive; the child calls ConnectToStage() for its children.
+ * This is recursive; the child calls ConnectToStage() for its children.
*/
-void Actor::ConnectToSceneGraph( int index )
+void Actor::ConnectToSceneGraph()
{
DALI_ASSERT_DEBUG( mNode != NULL); DALI_ASSERT_DEBUG( mParent != NULL); DALI_ASSERT_DEBUG( mParent->mNode != NULL );
if( NULL != mNode )
{
// Reparent Node in next Update
- ConnectNodeMessage( GetEventThreadServices().GetUpdateManager(), *(mParent->mNode), *mNode, index );
+ ConnectNodeMessage( GetEventThreadServices().GetUpdateManager(), *(mParent->mNode), *mNode );
}
// Notify attachment
return componentIndex;
}
-void Actor::SetParent( Actor* parent, int index )
+void Actor::SetParent( Actor* parent )
{
if( parent )
{
parent->OnStage() )
{
// Instruct each actor to create a corresponding node in the scene graph
- ConnectToStage( parent->GetHierarchyDepth(), index );
+ ConnectToStage( parent->GetHierarchyDepth() );
}
}
else // parent being set to NULL
/**
* Called on a child during Add() when the parent actor is connected to the Stage.
- * @param[in] stage The stage.
- * @param[in] parentDepth The depth of the parent in the hierarchy
- * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
+ * @param[in] parentDepth The depth of the parent in the hierarchy.
*/
- void ConnectToStage( unsigned int parentDepth, int index = -1 );
+ void ConnectToStage( unsigned int parentDepth );
/**
* Helper for ConnectToStage, to recursively connect a tree of actors.
* This is atomic i.e. not interrupted by user callbacks.
- * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
- * @param[in] depth The depth in the hierarchy of the actor
+ * @param[in] depth The depth in the hierarchy of the actor
* @param[out] connectionList On return, the list of connected actors which require notification.
*/
- void RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth, int index = -1 );
+ void RecursiveConnectToStage( ActorContainer& connectionList, unsigned int depth );
/**
* Connect the Node associated with this Actor to the scene-graph.
- * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
*/
- void ConnectToSceneGraph( int index = -1 );
+ void ConnectToSceneGraph();
/**
* Helper for ConnectToStage, to notify a connected actor through the public API.
/**
* Set the actors parent.
* @param[in] parent The new parent.
- * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
*/
- void SetParent( Actor* parent, int index = -1 );
+ void SetParent( Actor* parent );
/**
* Helper to create a Node for this Actor.
mImpl->activeDisconnectedNodes.insert( node ); // Takes ownership of node
}
-void UpdateManager::ConnectNode( Node* parent, Node* node, int index )
+void UpdateManager::ConnectNode( Node* parent, Node* node )
{
DALI_ASSERT_ALWAYS( NULL != parent );
DALI_ASSERT_ALWAYS( NULL != node );
node->SetActive( true );
- parent->ConnectChild( node, index );
+ parent->ConnectChild( node );
}
void UpdateManager::DisconnectNode( Node* node )
* Connect a Node to the scene-graph.
* A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
* @pre The node does not already have a parent.
- * @param[in] node The new parent node.
- * @param[in] node The node to connect.
+ * @param[in] parent The new parent node.
*/
- void ConnectNode( Node* parent, Node* node, int index );
+ void ConnectNode( Node* parent, Node* node );
/**
* Disconnect a Node from the scene-graph.
new (slot) LocalType( &manager, &UpdateManager::AddNode, &node );
}
-inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild, int index )
+inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
{
// Update thread can edit the object
Node& parent = const_cast< Node& >( constParent );
Node& child = const_cast< Node& >( constChild );
- typedef MessageValue3< UpdateManager, Node*, Node*, int > LocalType;
+ typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child, index );
+ new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
}
inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
mIsRoot = isRoot;
}
-void Node::ConnectChild( Node* childNode, int index )
+void Node::ConnectChild( Node* childNode )
{
DALI_ASSERT_ALWAYS( this != childNode );
DALI_ASSERT_ALWAYS( IsRoot() || NULL != mParent ); // Parent should be connected first
// Everything should be reinherited when reconnected to scene-graph
childNode->SetAllDirtyFlags();
- if (index == -1)
- {
- mChildren.PushBack( childNode );
- }
- else
- {
- mChildren.Insert(mChildren.Begin()+index, childNode);
- }
+ // Add the node to the end of the child list.
+ mChildren.PushBack( childNode );
// Inform property observers of new connection
childNode->ConnectToSceneGraph();
* @pre The childNode does not already have a parent.
* @pre The childNode is not a root node.
* @param[in] childNode The child to add.
- * @param[in] index to insert at, if not supplied or -1 it will be appended
- *
*/
- void ConnectChild( Node* childNode, int index = -1);
+ void ConnectChild( Node* childNode );
/**
* Disconnect a child (& its children) from the scene-graph.