- if( childActor->IsLayer() )
- {
- Layer* layer = static_cast<Layer*>(childActor);
- if( layer->GetBehavior() == Dali::Layer::LAYER_3D )
- {
- // Ignore this actor and children.
- continue;
- }
- }
-
- // If no existing depth node children
- if( node->mFirstChildNode == NULL )
- {
- node->mFirstChildNode = new (nodeMemoryPool.AllocateRaw()) ActorDepthTreeNode( childActor, childActor->mSiblingOrder );
- node->mFirstChildNode->mParentNode = node;
- storedChildren.push_back(ActorNodePair( childActor, node->mFirstChildNode ));
- }
- else // find child node with matching sibling order (insertion sort)
- {
- bool addedChildActor = false;
-
- // depth tree child nodes ordered by sibling order
- ActorDepthTreeNode* lastNode = NULL;
- for( ActorDepthTreeNode* childNode = node->mFirstChildNode; childNode != NULL; childNode = childNode->mNextSiblingNode )
- {
- uint16_t actorSiblingOrder = childActor->mSiblingOrder;
- uint16_t currentSiblingOrder = childNode->GetSiblingOrder();
-
- if( actorSiblingOrder == currentSiblingOrder )
- {
- // Don't need a new depth node, add to existing node
- childNode->AddActor( childActor );
- storedChildren.push_back(ActorNodePair( childActor, childNode ));
- addedChildActor = true;
- break;
- }
- else if( actorSiblingOrder < currentSiblingOrder )
- {
- break;
- }
- lastNode = childNode;
- }
-
- // No matching sibling order - create new node and insert into sibling list
- if( !addedChildActor )
- {
- ActorDepthTreeNode* newNode = new (nodeMemoryPool.AllocateRaw()) ActorDepthTreeNode( childActor, childActor->mSiblingOrder );
-
- newNode->mParentNode = node;
- storedChildren.push_back(ActorNodePair( childActor, newNode ));
-
- if( lastNode == NULL ) // Insert at start of siblings
- {
- ActorDepthTreeNode* nextNode = node->mFirstChildNode;
- node->mFirstChildNode = newNode;
- newNode->mNextSiblingNode = nextNode;
- }
- else // insert into siblings after last node
- {
- newNode->mNextSiblingNode = lastNode->mNextSiblingNode;
- lastNode->mNextSiblingNode = newNode;
- }
- }
- }
- }
-
- // Order of descent doesn't matter; we're using insertion to sort.
- for( std::vector<ActorNodePair>::iterator iter = storedChildren.begin(); iter != storedChildren.end(); ++iter )
- {
- treeCount += iter->actor->BuildDepthTree( nodeMemoryPool, iter->node );
- }
- }
- return treeCount;
-}
-
-unsigned int Actor::GetDefaultPropertyCount() const
-{
- return DEFAULT_PROPERTY_COUNT;
-}
-
-void Actor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
- indices.Reserve( DEFAULT_PROPERTY_COUNT );
-
- for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
- {
- indices.PushBack( i );
- }
-}
-
-const char* Actor::GetDefaultPropertyName( Property::Index index ) const
-{
- if( index < DEFAULT_PROPERTY_COUNT )
- {
- return DEFAULT_PROPERTY_DETAILS[ index ].name;
- }
-
- return NULL;
-}
-
-Property::Index Actor::GetDefaultPropertyIndex( const std::string& name ) const
-{
- Property::Index index = Property::INVALID_INDEX;
-
- // Look for name in default properties
- for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
- {
- const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
- if( 0 == name.compare( property->name ) )
- {
- index = i;
- break;
- }
- }
-
- return index;
-}
-
-bool Actor::IsDefaultPropertyWritable( Property::Index index ) const
-{
- if( index < DEFAULT_PROPERTY_COUNT )
- {
- return DEFAULT_PROPERTY_DETAILS[ index ].writable;
- }
-
- return false;
-}
-
-bool Actor::IsDefaultPropertyAnimatable( Property::Index index ) const
-{
- if( index < DEFAULT_PROPERTY_COUNT )
- {
- return DEFAULT_PROPERTY_DETAILS[ index ].animatable;
- }
-
- return false;
-}
-
-bool Actor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
- if( index < DEFAULT_PROPERTY_COUNT )
- {
- return DEFAULT_PROPERTY_DETAILS[ index ].constraintInput;
- }
-
- return false;
-}
-
-Property::Type Actor::GetDefaultPropertyType( Property::Index index ) const
-{
- if( index < DEFAULT_PROPERTY_COUNT )
- {
- return DEFAULT_PROPERTY_DETAILS[ index ].type;
- }
-
- // index out of range...return Property::NONE
- return Property::NONE;
-}