当前位置: 首页>>代码示例>>C++>>正文


C++ ChildIterator类代码示例

本文整理汇总了C++中ChildIterator的典型用法代码示例。如果您正苦于以下问题:C++ ChildIterator类的具体用法?C++ ChildIterator怎么用?C++ ChildIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ChildIterator类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveToXML

bool PanelCreator::SaveToXML( GuiObjectCPtr _spObject, CFoundation::XMLDocumentPtr _spDoc, CFoundation::XMLElementPtr _spXMLElement ) const
{
	GuiObjectCreator::SaveToXML( _spObject, _spDoc, _spXMLElement );

	PanelCPtr spPanel = static_pointer_cast< const Panel >( _spObject );

	// save children
	ChildIterator clIterator = spPanel->GetChildIterator();
	GuiObjectPtr pChild = clIterator.GetFirst();
	while( !clIterator.IsDone() )
	{
		// Create new XML node
		CFoundation::XMLElementPtr spChildXMLElement = _spDoc->CreateElement( pChild->GetTypeId() );

		// Add as child
		_spXMLElement->InsertChildLast( spChildXMLElement );

        // Save child
		GuiMain::GetInstance().SaveToXML( pChild, _spDoc, spChildXMLElement );

		pChild = clIterator.GetNext();
	}

    return true;
}
开发者ID:coeing,项目名称:cframework,代码行数:25,代码来源:Panel.cpp

示例2: getChildIterator

    OverlayElement* OverlayContainer::findElementAt(Real x, Real y)         // relative to parent
    {

        OverlayElement* ret = NULL;

        int currZ = -1;

        if (mVisible)
        {
            ret = OverlayElement::findElementAt(x,y);   //default to the current container if no others are found
            if (ret && mChildrenProcessEvents)
            {
                ChildIterator it = getChildIterator();
                while (it.hasMoreElements())
                {
                    OverlayElement* currentOverlayElement = it.getNext();
                    if (currentOverlayElement->isVisible() && currentOverlayElement->isEnabled())
                    {
                        int z = currentOverlayElement->getZOrder();
                        if (z > currZ)
                        {
                            OverlayElement* elementFound = currentOverlayElement->findElementAt(x ,y );
                            if (elementFound)
                            {
                                currZ = z;
                                ret = elementFound;
                            }
                        }
                    }
                }
            }
        }
        return ret;
    }
开发者ID:yiliu1203,项目名称:OGRE,代码行数:34,代码来源:OgreOverlayContainer.cpp

示例3: removeChild

void SymbolNode::removeChild(const SymbolInfo &inf)
{
	ChildIterator pChild = m_childList.find(inf);
	if (pChild != m_childList.end())
	{
		pChild.value()->m_parent = WeakPtr();
		m_childList.remove(inf);
	}
}
开发者ID:league1991,项目名称:CodeAtlas,代码行数:9,代码来源:SymbolNode.cpp

示例4: recursivelyMarkIf

    void recursivelyMarkIf(Node* start, const NodeConditional& nc) {
        if (nc(&*start)) {
            start->mark |= MARK_KEEP | MARK_KEEP_KIDS;

            for (ChildIterator ci = childBegin(start); !ci.done(); ++ci) {
                recursivelyMarkIf(&*ci, nc);
            }
        } else {
            start->mark |= MARK_KEEP;
        }
    }
开发者ID:Awilg,项目名称:go-ai,代码行数:11,代码来源:tree.hpp

示例5: getChildIterator

    //---------------------------------------------------------------------
    void OverlayContainer::_notifyZOrder(ushort newZOrder)
    {
        OverlayElement::_notifyZOrder(newZOrder);

        // Update children
        ChildIterator it = getChildIterator();
        while (it.hasMoreElements())
        {
            // Give children ZOrder 1 higher than this
            it.getNext()->_notifyZOrder(newZOrder + 1);
        }
    }
开发者ID:brock7,项目名称:TianLong,代码行数:13,代码来源:OgreOverlayContainer.cpp

示例6: children

int ProtoNode::childrenCount() const
{
    if (!node_) return 0;

    int row_count = 0;
    ChildIterator kids = children();
    while ( kids.element().isValid() )
    {
        row_count++;
        kids.next();
    }

    return row_count;
}
开发者ID:wireshark,项目名称:wireshark,代码行数:14,代码来源:proto_node.cpp

示例7: getChildIterator

/** Overridden from OverlayContainer */
void cCompassOverlay::_updateRenderQueue(RenderQueue* queue) {
	if (mVisible)
	{

		if (!mTransparent && !mpMaterial.isNull())
		{
			OverlayElement::_updateRenderQueue(queue);
		}

		// Also add children
		ChildIterator it = getChildIterator();
		while (it.hasMoreElements())
		{
			// Give children ZOrder 1 higher than this
			it.getNext()->_updateRenderQueue(queue);
		}
	}
}
开发者ID:ghoulsblade,项目名称:vegaogre,代码行数:19,代码来源:lugre_CompassOverlay.cpp

示例8: eraseChildrenOfUnmarkedNodes

    /*!
        Destroys children of nodes that are not marked,
        defragments the node array
        always keeps the root

        Note: invalidates all pointers to nodes of the tree, and all
              iterators.
    */
    void eraseChildrenOfUnmarkedNodes() {
        unsigned int write = 0;

        nodes[root_index].mark = MARK_KEEP;

        assert(root_index < allocation_index);

        for (unsigned int read = root_index; read != allocation_index; read++) {
               Node *node = &nodes[read];
            char mark = node->mark;

            if (mark) {
                // TODO: could handle read == write as a special case
                Node *write_node  = &nodes[write];
                *write_node = *node; // copy
                write_node->mark = 0; // clear mark

                if (mark & MARK_KEEP_KIDS) {
                    // adjust children's parent pointers
                    for (ChildIterator it = childBegin(write_node); !it.done(); ++it) {
                        it->parent = write;
                    }
                } else {
                    write_node->num_children = 0;
                }

                // adjust parent's first_child "pointer" if this is its first child
                if (read != root_index) {
                    Node* parent_node = getParent(node);
                    if (write < parent_node->first_child) {
                        parent_node->first_child = write;
                    }
                 }


                   write++;
            }
        }
        root_index = 0;
        nodes[root_index].parent = 0;
        allocation_index = write;
    }
开发者ID:Awilg,项目名称:go-ai,代码行数:50,代码来源:tree.hpp

示例9: scriptNode

void Box::exportForReference( const std::string &fileName ) const
{
	const ScriptNode *script = scriptNode();
	if( !script )
	{
		throw IECore::Exception( "Box::exportForReference called without ScriptNode" );
	}

	// we only want to save out our child nodes and plugs that are visible in the UI, so we build a filter
	// to specify just the things to export.

	boost::regex invisiblePlug( "^__.*$" );
	StandardSetPtr toExport = new StandardSet;
	for( ChildIterator it = children().begin(), eIt = children().end(); it != eIt; ++it )
	{
		if( (*it)->isInstanceOf( Node::staticTypeId() ) )
		{
			toExport->add( *it );
		}
		else if( const Plug *plug = IECore::runTimeCast<Plug>( it->get() ) )
		{
			if( !boost::regex_match( plug->getName().c_str(), invisiblePlug ) )
			{
				toExport->add( *it );
			}
		}
	}

	ContextPtr context = new Context;
	context->set( "valuePlugSerialiser:resetParentPlugDefaults", true );
	context->set( "serialiser:includeParentMetadata", true );
	context->set( "serialiser:includeVersionMetadata", true );
	Context::Scope scopedContext( context.get() );

	script->serialiseToFile( fileName, this, toExport.get() );
}
开发者ID:Eryckz,项目名称:gaffer,代码行数:36,代码来源:Box.cpp


注:本文中的ChildIterator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。