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


C++ Group::getNumChildren方法代码示例

本文整理汇总了C++中osg::Group::getNumChildren方法的典型用法代码示例。如果您正苦于以下问题:C++ Group::getNumChildren方法的具体用法?C++ Group::getNumChildren怎么用?C++ Group::getNumChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osg::Group的用法示例。


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

示例1: traverse

void
ShaderGenerator::apply(osg::Group& group)
{
    if ( !_active ) return;

    traverse(group);

#if 0
    std::set<VirtualProgram*> childVPs;
    unsigned childrenWithVP = 0;
    for(unsigned i=0; i<group.getNumChildren(); ++i)
    {
        osg::StateSet* stateset = group.getChild(i)->getStateSet();
        if ( !stateset )
            break;

        VirtualProgram* vp = dynamic_cast<VirtualProgram*>(stateset->getAttribute(VirtualProgram::SA_TYPE));
        if ( vp )
        {
            childVPs.insert( vp );
            childrenWithVP++;
        }
    }
    if ( childrenWithVP == group.getNumChildren() && childVPs.size() == 1 )
    {
        group.getOrCreateStateSet()->setAttributeAndModes( *childVPs.begin(), 1 );
        for(unsigned i=0; i<group.getNumChildren(); ++i)
        {
            group.getChild(i)->getStateSet()->removeAttribute(VirtualProgram::SA_TYPE);
        }
    }
#endif
}
开发者ID:dsallen,项目名称:osgearth,代码行数:33,代码来源:ShaderGenerator.cpp

示例2: apply

// apply method for groups
void GeometryExtractorVisitor::apply( osg::Group& group ) {
	
	// call the appropriate apply method for all children
	if( group.getNumChildren() > 0 ) {
		for( unsigned int i = 0; i < group.getNumChildren(); i++) {
			osg::Node* node = group.getChild( i );
			apply( *node );
		}
	}
}
开发者ID:szakats,项目名称:bzflag_mirror,代码行数:11,代码来源:GeometryExtractorVisitor.cpp

示例3: if

void CVRCullVisitor::PreCullVisitor::apply(osg::Group& group)
{
    bool setMask = false;
    for(int i = 0; i < group.getNumChildren(); i++)
    {
        _setMask = false;
        group.getChild(i)->accept(*this);
        if(_setMask)
        {
            setMask = true;
        }
    }

    if(group.getNodeMask() & FIRST_CULL_STATUS)
    {
        _setMask = true;
    }
    else if(setMask)
    {
        //std::cerr << "Pulling up node mask." << std::endl;
        _setMask = true;
        group.setNodeMask(group.getNodeMask() | FIRST_CULL_STATUS);
    }

}
开发者ID:megasha,项目名称:calvr,代码行数:25,代码来源:CVRCullVisitor.cpp

示例4: while

void
RemoveEmptyGroupsVisitor::apply( osg::Group& group )
{
    bool removed = true;
    while( removed )
    {
        removed = false;
        for( unsigned i = 0; i < group.getNumChildren(); ++i )
        {
            osg::Group* child = group.getChild(i)->asGroup();
            if ( child )
            {
                if (child->className() == std::string("Group") &&
                    child->getStateSet() == 0L            &&
                    child->getCullCallback() == 0L        &&
                    child->getUpdateCallback() == 0L      &&
                    child->getUserData() == 0L            &&
                    child->getName().empty()              &&
                    child->getDescriptions().size() == 0 )
                {
                    for( unsigned j = 0; j < child->getNumChildren(); ++j )
                    {
                        group.addChild( child->getChild( j ) );
                    }

                    group.removeChild( i-- );
                    removed = true;
                }                
            }
        }
    }

    traverse(group);
}
开发者ID:airwzz999,项目名称:osgearth-for-android,代码行数:34,代码来源:NodeUtils.cpp

示例5: writeChildren

static bool writeChildren( osgDB::OutputStream& os, const osg::Group& node )
{
    unsigned int size = node.getNumChildren();
    os << size << osgDB::BEGIN_BRACKET << std::endl;
    for ( unsigned int i=0; i<size; ++i )
    {
        os << node.getChild(i);
    }
    os << osgDB::END_BRACKET << std::endl;
    return true;
}
开发者ID:aalex,项目名称:osg,代码行数:11,代码来源:Group.cpp

示例6: apply

	virtual void apply(osg::Group &group ) {
		for (unsigned int i = 0; i<group.getNumChildren(); ) {
			if( dynamic_cast<osgAL::SoundRoot*>(group.getChild(i)) && _mode==SEARCH_AND_DESTROY ) {
				group.removeChild(i);
			} else {
				if (dynamic_cast<osgAL::SoundRoot*>(group.getChild(i)) && _mode==SEARCH)
					_found_count++;

				group.getChild(i)->accept(*this);
				i++;
			}
		}
	}
开发者ID:leloulight,项目名称:lbanet,代码行数:13,代码来源:osgalviewer.cpp

示例7: apply

 virtual void apply(osg::Group& group)
 {
     for (unsigned int i = 0; i < group.getNumChildren(); i++)
     {
         osg::Node* child = group.getChild(i);
         osg::Node* seam = seamReplacement(child);
         if (child != seam)
         {
             group.replaceChild(child,seam);
         }
         else
         {
             child->accept(*this);
         }
     }
 }
开发者ID:jesesun,项目名称:OpenSceneGraph,代码行数:16,代码来源:ReaderWriterTXP.cpp

示例8: apply

void
GeometryValidator::apply(osg::Group& group)
{
    for(unsigned i=0; i<group.getNumChildren(); ++i)
    {
        osg::Geometry* geom = group.getChild(i)->asGeometry();
        if ( geom )
        {
            apply( *geom );
            if ( geom->getVertexArray() == 0L )
            {
                OE_NOTICE << "removing " << geom->getName() << " b/c of null vertex array\n";
                group.removeChild(geom);
                --i;
            }
        }
    }
}
开发者ID:pprabhu78,项目名称:osgearth,代码行数:18,代码来源:Utils.cpp

示例9: pushStateSet

void
CountsVisitor::apply(osg::Group& node)
{
    pushStateSet(node.getStateSet());

    _groups++;
    osg::ref_ptr<osg::Object> rp = (osg::Object*)&node;
    _uGroups.insert(rp);
    _totalChildren += node.getNumChildren();
    apply(node.getStateSet());

    if (++_depth > _maxDepth)
        _maxDepth = _depth;
    traverse((osg::Node&)node);
    _depth--;

    popStateSet();
}
开发者ID:lemonrong,项目名称:osg3DViewer,代码行数:18,代码来源:CountsVisitor.cpp

示例10: checkChildren

static bool checkChildren( const osg::Group& node )
{
    return node.getNumChildren()>0;
}
开发者ID:aalex,项目名称:osg,代码行数:4,代码来源:Group.cpp


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