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


C++ MapNodeOptions::getConfig方法代码示例

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


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

示例1: ProxySettings

MapNodeOptions::MapNodeOptions( const MapNodeOptions& rhs ) :
_proxySettings         ( ProxySettings() ),
_cacheOnly             ( false ),
_enableLighting        ( true ),
_overlayBlending       ( true ),
_overlayTextureSize    ( 4096 ),
_overlayMipMapping     ( false ),
_overlayAttachStencil  ( false ),
_overlayResolutionRatio( 5.0f ),
_terrainOptions        ( 0L )
{
    mergeConfig( rhs.getConfig() );
}
开发者ID:dreamfrog,项目名称:osgearth,代码行数:13,代码来源:MapNodeOptions.cpp

示例2: to

osg::Group*
MapNodeHelper::load(osg::ArgumentParser&  args,
                    osgViewer::View*      view,
                    Container*            userContainer,
                    const osgDB::Options* readOptions) const
{
    // do this first before scanning for an earth file
    std::string outEarth;
    args.read( "--out-earth", outEarth );

    osg::ref_ptr<osgDB::Options> myReadOptions = Registry::cloneOrCreateOptions(readOptions);
    
    Config c;
    c.add("elevation_smoothing", false);
    TerrainOptions to(c);

    MapNodeOptions defMNO;
    defMNO.setTerrainOptions( to );

    myReadOptions->setPluginStringData("osgEarth.defaultOptions", defMNO.getConfig().toJSON());

    // read in the Earth file:
    osg::Node* node = osgDB::readNodeFiles(args, myReadOptions.get());

    osg::ref_ptr<MapNode> mapNode;
    if ( !node )
    {
        if ( args.find("--images") < 0 )
        {
            OE_WARN << LC << "No earth file." << std::endl;
            return 0L;
        }
        else
        {
            mapNode = new MapNode();
        }
    }
    else
    {
        mapNode = MapNode::get(node);
        if ( !mapNode.valid() )
        {
            OE_WARN << LC << "Loaded scene graph does not contain a MapNode - aborting" << std::endl;
            return 0L;
        }
    }

    // warn about not having an earth manip
    if ( view )
    {
        EarthManipulator* manip = dynamic_cast<EarthManipulator*>(view->getCameraManipulator());
        if ( manip == 0L )
        {
            OE_WARN << LC << "Helper used before installing an EarthManipulator" << std::endl;
        }
    }

    // a root node to hold everything:
    osg::Group* root = new osg::Group();
    
    root->addChild( node );

    // parses common cmdline arguments.
    if ( view )
    {
        parse( mapNode.get(), args, view, root, userContainer );
    }

    // Dump out an earth file if so directed.
    if ( !outEarth.empty() )
    {
        OE_NOTICE << LC << "Writing earth file: " << outEarth << std::endl;
        osgDB::writeNodeFile( *mapNode, outEarth );
    }

    // configures the viewer with some stock goodies
    if ( view )
    {
        configureView( view );
    }
    
    return root;
}
开发者ID:469447793,项目名称:osgearth,代码行数:83,代码来源:ExampleResources.cpp

示例3: to

osg::Group*
MapNodeHelper::load(osg::ArgumentParser&   args,
                    osgViewer::ViewerBase* viewer,
                    Container*             userContainer,
                    const osgDB::Options*  readOptions) const
{
    // do this first before scanning for an earth file
    std::string outEarth;
    args.read( "--out-earth", outEarth );

    osg::ref_ptr<osgDB::Options> myReadOptions = Registry::cloneOrCreateOptions(readOptions);
    
    Config c;
    c.add("elevation_smoothing", false);
    TerrainOptions to(c);

    MapNodeOptions defMNO;
    defMNO.setTerrainOptions( to );

    myReadOptions->setPluginStringData("osgEarth.defaultOptions", defMNO.getConfig().toJSON());

    // read in the Earth file:
    osg::ref_ptr<osg::Node> node = osgDB::readNodeFiles(args, myReadOptions.get());

    osg::ref_ptr<MapNode> mapNode;
    if ( !node )
    {
        if ( args.find("--images") < 0 )
        {
            OE_WARN << LC << "No earth file." << std::endl;
            return 0L;
        }
        else
        {
            mapNode = new MapNode();
        }
    }
    else
    {
        mapNode = MapNode::get(node.get());
        if ( !mapNode.valid() )
        {
            OE_WARN << LC << "Loaded scene graph does not contain a MapNode - aborting" << std::endl;
            return 0L;
        }
    }

    // collect the views
    osgViewer::Viewer::Views views;
    if (viewer)
    {
        viewer->getViews(views);
    }

    // warn about not having an earth manip
    for (osgViewer::Viewer::Views::iterator view = views.begin(); view != views.end(); ++view)
    {
        EarthManipulator* manip = dynamic_cast<EarthManipulator*>((*view)->getCameraManipulator());
        if ( manip == 0L )
        {
            OE_WARN << LC << "Helper used before installing an EarthManipulator" << std::endl;
        }
    }

    // a root node to hold everything:
    osg::Group* root = new osg::Group();
    
    root->addChild( node );

    // parses common cmdline arguments and apply to the first view:
    if ( !views.empty() )
    {
        parse( mapNode.get(), args, views.front(), root, userContainer );
    }

    // Dump out an earth file if so directed.
    if ( !outEarth.empty() )
    {
        OE_NOTICE << LC << "Writing earth file: " << outEarth << std::endl;
        osgDB::writeNodeFile( *mapNode, outEarth );
    }

    // configures each view with some stock goodies
    for (osgViewer::Viewer::Views::iterator view = views.begin(); view != views.end(); ++view)
    {
        configureView( *view );
    }

#ifdef OSG_GL3_AVAILABLE
    if (viewer)
    {
        viewer->realize();
        for (osgViewer::Viewer::Views::iterator view = views.begin(); view != views.end(); ++view)
        {
            osg::State* state = (*view)->getCamera()->getGraphicsContext()->getState();
            state->setUseModelViewAndProjectionUniforms(true);
            state->setUseVertexAttributeAliasing(true);
        }        
    }
#endif
//.........这里部分代码省略.........
开发者ID:mathieu,项目名称:osgearth,代码行数:101,代码来源:ExampleResources.cpp


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