本文整理汇总了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() );
}
示例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;
}
示例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
//.........这里部分代码省略.........