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


C++ const_iterator::children方法代码示例

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


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

示例1: XmlElement

XmlElement::XmlElement( const Config& conf )
{
    name = conf.key();
    for( Properties::const_iterator i = conf.attrs().begin(); i != conf.attrs().end(); i++ )
        attrs[i->first] = i->second;
    for( ConfigSet::const_iterator j = conf.children().begin(); j != conf.children().end(); j++ )
    {
        if (!j->children().empty())
        {
            children.push_back( new XmlElement( *j ) );
        }
        else
        {
            addSubElement(j->key(), j->attrs(), j->value());
        }
    }
}
开发者ID:jehc,项目名称:osgearth,代码行数:17,代码来源:XmlUtils.cpp

示例2: if

XmlElement::XmlElement( const Config& conf )
{
    name = conf.key();

    if ( !conf.value().empty() )
    {
        children.push_back( new XmlText(conf.value()) );
    }

    for( ConfigSet::const_iterator j = conf.children().begin(); j != conf.children().end(); j++ )
    {
        if ( j->isSimple() )
        {
            attrs[j->key()] = j->value();
        }
        else if ( j->children().size() > 0 )
        {
            children.push_back( new XmlElement(*j) );
        }
    }
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:21,代码来源:XmlUtils.cpp

示例3: mapOptions

osg::Node*
EarthFileSerializer2::deserialize( const Config& conf, const std::string& referrer ) const
{
    // First, pre-load any extension DLLs.
    preloadExtensionLibs(conf);
    preloadExtensionLibs(conf.child("extensions"));
    preloadExtensionLibs(conf.child("external"));

    MapOptions mapOptions( conf.child( "options" ) );

    // legacy: check for name/type in top-level attrs:
    if ( conf.hasValue( "name" ) || conf.hasValue( "type" ) )
    {
        Config legacy;
        if ( conf.hasValue("name") ) legacy.add( "name", conf.value("name") );
        if ( conf.hasValue("type") ) legacy.add( "type", conf.value("type") );
        mapOptions.mergeConfig( legacy );
    }

    osg::ref_ptr< Map > map = new Map( mapOptions );

    // Start a batch update of the map:
    map->beginUpdate();

    // Read all the elevation layers in FIRST so other layers can access them for things like clamping.
    // TODO: revisit this since we should really be listening for elevation data changes and
    // re-clamping based on that..
    for(ConfigSet::const_iterator i = conf.children().begin(); i != conf.children().end(); ++i)
    {
        // for backwards compatibility:
        if (i->key() == "heightfield")
        {
            Config temp = *i;
            temp.key() = "elevation";
            addLayer(temp, map);
        }

        else if ( i->key() == "elevation" ) // || i->key() == "heightfield" )
        {
            addLayer(*i, map);
        }
    }

    Config externalConfig;
    std::vector<osg::ref_ptr<Extension> > extensions;

    // Read the layers in LAST (otherwise they will not benefit from the cache/profile configuration)
    for(ConfigSet::const_iterator i = conf.children().begin(); i != conf.children().end(); ++i)
    {
        if (i->key() == "options" || i->key() == "name" || i->key() == "type" || i->key() == "version")
        {
            // nop - handled earlier
        }

#if 0
        else if ( i->key() == "image" )
        {
            addImageLayer( *i, map );
        }

        else */if ( i->key() == "model" )
        {
            addModelLayer( *i, map );
        }

        else if ( i->key() == "mask" )
        {
            addMaskLayer( *i, map );
        }
#endif

        else if ( i->key() == "external" || i->key() == "extensions" )
        {
            externalConfig = *i;
            
            for(ConfigSet::const_iterator e = i->children().begin(); e != i->children().end(); ++e)
            {
                Extension* extension = loadExtension(*e);
                if (extension)
                    extensions.push_back(extension);
                //addExtension( *e, mapNode.get() );
            }
        }

        else if ( !isReservedWord(i->key()) ) // plugins/extensions.
        {
            // try to add as a plugin Layer first:
            bool addedLayer = addLayer(*i, map); 

            // failing that, try to load as an extension:
            if ( !addedLayer )
            {
                Extension* extension = loadExtension(*i);
                if (extension)
                    extensions.push_back(extension);
            }
        }
    }

    // Complete the batch update of the map
//.........这里部分代码省略.........
开发者ID:caishanli,项目名称:osgearth,代码行数:101,代码来源:EarthFileSerializer2.cpp


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