本文整理汇总了C++中TerrainOptions类的典型用法代码示例。如果您正苦于以下问题:C++ TerrainOptions类的具体用法?C++ TerrainOptions怎么用?C++ TerrainOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TerrainOptions类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Terrain
void
TerrainEngineNode::preInitialize( const Map* map, const TerrainOptions& options )
{
_map = map;
// fire up a terrain utility interface
_terrainInterface = new Terrain( this, map->getProfile(), map->isGeocentric(), options );
// set up the CSN values
_map->getProfile()->getSRS()->populateCoordinateSystemNode( this );
// OSG's CSN likes a NULL ellipsoid to represent projected mode.
if ( !_map->isGeocentric() )
this->setEllipsoidModel( NULL );
// install the proper layer composition technique:
_texCompositor = new TextureCompositor();
// then register the callback so we can process further map model changes
_map->addMapCallback( new TerrainEngineNodeCallbackProxy( this ) );
// enable backface culling
osg::StateSet* set = getOrCreateStateSet();
set->setMode( GL_CULL_FACE, 1 );
if ( options.enableMercatorFastPath().isSet() )
{
OE_INFO
<< LC << "Mercator fast path "
<< (options.enableMercatorFastPath()==true? "enabled" : "DISABLED") << std::endl;
}
_initStage = INIT_PREINIT_COMPLETE;
}
开发者ID:DavidLeehome,项目名称:osgearth,代码行数:34,代码来源:TerrainEngineNode.cpp
示例2: mapf
void
TerrainEngineNode::setMap(const Map* map, const TerrainOptions& options)
{
if (!map) return;
_map = map;
// Create a terrain utility interface. This interface can be used
// to query the in-memory terrain graph, subscribe to tile events, etc.
_terrainInterface = new Terrain( this, map->getProfile(), map->isGeocentric(), options );
// Set up the CSN values. We support this because some manipulators look for it,
// but osgEarth itself doesn't use it.
_map->getProfile()->getSRS()->populateCoordinateSystemNode( this );
// OSG's CSN likes a NULL ellipsoid to represent projected mode.
if ( !_map->isGeocentric() )
this->setEllipsoidModel( NULL );
// Install an object to manage texture image unit usage:
_textureResourceTracker = new TextureCompositor();
std::set<int> offLimits = osgEarth::Registry::instance()->getOffLimitsTextureImageUnits();
for(std::set<int>::const_iterator i = offLimits.begin(); i != offLimits.end(); ++i)
_textureResourceTracker->setTextureImageUnitOffLimits( *i );
// Register a callback so we can process further map model changes
_map->addMapCallback( new TerrainEngineNodeCallbackProxy(this) );
// Force a render bin if specified in the options
if ( options.binNumber().isSet() )
{
osg::StateSet* set = getOrCreateStateSet();
set->setRenderBinDetails( options.binNumber().get(), "RenderBin" );
}
// This is the object that creates the data model for each terrain tile.
_tileModelFactory = new TerrainTileModelFactory(options);
// Manually trigger the map callbacks the first time:
if (_map->getProfile())
onMapInfoEstablished(MapInfo(_map));
// Create a layer controller. This object affects the uniforms
// that control layer appearance properties
_imageLayerController = new ImageLayerController(_map, this);
// register the layer Controller it with all pre-existing image layers:
MapFrame mapf(_map);
ImageLayerVector imageLayers;
mapf.getLayers(imageLayers);
for (ImageLayerVector::const_iterator i = imageLayers.begin(); i != imageLayers.end(); ++i)
{
i->get()->addCallback(_imageLayerController.get());
}
_initStage = INIT_POSTINIT_COMPLETE;
}
开发者ID:ldelgass,项目名称:osgearth,代码行数:58,代码来源:TerrainEngineNode.cpp
示例3:
TextureCompositorMultiTexture::TextureCompositorMultiTexture( bool useGPU, const TerrainOptions& options ) :
_lodTransitionTime( *options.lodTransitionTime() ),
_enableMipmapping ( *options.enableMipmapping() ),
_minFilter ( *options.minFilter() ),
_magFilter ( *options.magFilter() ),
_useGPU ( useGPU )
{
_enableMipmappingOnUpdatedTextures = Registry::capabilities().supportsMipmappedTextureUpdates();
}
开发者ID:AlexBobkov,项目名称:osgearth,代码行数:9,代码来源:TextureCompositorMulti.cpp
示例4: mapf
void
TerrainEngineNode::preInitialize( const Map* map, const TerrainOptions& options )
{
_map = map;
// fire up a terrain utility interface
_terrainInterface = new Terrain( this, map->getProfile(), map->isGeocentric(), options );
// set up the CSN values
_map->getProfile()->getSRS()->populateCoordinateSystemNode( this );
// OSG's CSN likes a NULL ellipsoid to represent projected mode.
if ( !_map->isGeocentric() )
this->setEllipsoidModel( NULL );
// install the proper layer composition technique:
_texCompositor = new TextureCompositor( options );
// prime the compositor with pre-existing image layers:
MapFrame mapf(map, Map::IMAGE_LAYERS);
for( unsigned i=0; i<mapf.imageLayers().size(); ++i )
{
_texCompositor->applyMapModelChange( MapModelChange(
MapModelChange::ADD_IMAGE_LAYER,
mapf.getRevision(),
mapf.getImageLayerAt(i),
i ) );
}
// then register the callback so we can process further map model changes
_map->addMapCallback( new TerrainEngineNodeCallbackProxy( this ) );
// enable backface culling
osg::StateSet* set = getOrCreateStateSet();
//set->setAttributeAndModes( new osg::CullFace( osg::CullFace::BACK ), osg::StateAttribute::ON );
set->setMode( GL_CULL_FACE, 1 );
// elevation uniform
// NOTE: wrong...this should be per-CullVisitor...consider putting in the Culling::CullUserData
_cameraElevationUniform = new osg::Uniform( osg::Uniform::FLOAT, "osgearth_CameraElevation" );
_cameraElevationUniform->set( 0.0f );
set->addUniform( _cameraElevationUniform.get() );
set->getOrCreateUniform( "osgearth_ImageLayerAttenuation", osg::Uniform::FLOAT )->set(
*options.attentuationDistance() );
if ( options.enableMercatorFastPath().isSet() )
{
OE_INFO
<< LC << "Mercator fast path "
<< (options.enableMercatorFastPath()==true? "enabled" : "DISABLED") << std::endl;
}
_initStage = INIT_PREINIT_COMPLETE;
}
开发者ID:flybpc,项目名称:osgearth,代码行数:55,代码来源:TerrainEngineNode.cpp
示例5:
void
TerrainEngineNode::validateTerrainOptions( TerrainOptions& options )
{
// make sure all the requested properties are compatible, and fall back as necessary.
//const Capabilities& caps = Registry::instance()->getCapabilities();
// warn against mixing multipass technique with preemptive/sequential mode:
if (options.compositingTechnique() == TerrainOptions::COMPOSITING_MULTIPASS &&
options.loadingPolicy()->mode() != LoadingPolicy::MODE_STANDARD )
{
OE_WARN << LC << "MULTIPASS compositor is incompatible with preemptive/sequential loading policy; "
<< "falling back on STANDARD mode" << std::endl;
options.loadingPolicy()->mode() = LoadingPolicy::MODE_STANDARD;
}
}
开发者ID:flybpc,项目名称:osgearth,代码行数:15,代码来源:TerrainEngineNode.cpp
示例6: Terrain
void
TerrainEngineNode::preInitialize( const Map* map, const TerrainOptions& options )
{
_map = map;
// fire up a terrain utility interface
_terrainInterface = new Terrain( this, map->getProfile(), map->isGeocentric(), options );
// set up the CSN values
_map->getProfile()->getSRS()->populateCoordinateSystemNode( this );
// OSG's CSN likes a NULL ellipsoid to represent projected mode.
if ( !_map->isGeocentric() )
this->setEllipsoidModel( NULL );
// install an object to manage texture image unit usage:
_texCompositor = new TextureCompositor();
std::set<int> offLimits = osgEarth::Registry::instance()->getOffLimitsTextureImageUnits();
for(std::set<int>::const_iterator i = offLimits.begin(); i != offLimits.end(); ++i)
_texCompositor->setTextureImageUnitOffLimits( *i );
// then register the callback so we can process further map model changes
_map->addMapCallback( new TerrainEngineNodeCallbackProxy( this ) );
// apply render bin if necessary
if ( options.binNumber().isSet() )
{
osg::StateSet* set = getOrCreateStateSet();
set->setRenderBinDetails( options.binNumber().get(), "RenderBin" );
}
if ( options.enableMercatorFastPath().isSet() )
{
OE_INFO
<< LC << "Mercator fast path "
<< (options.enableMercatorFastPath()==true? "enabled" : "DISABLED") << std::endl;
}
// a default factory - this is the object that creates the data model for
// each terrain tile.
_tileModelFactory = new TerrainTileModelFactory(options);
_initStage = INIT_PREINIT_COMPLETE;
}
开发者ID:philipdumont,项目名称:osgearth,代码行数:44,代码来源:TerrainEngineNode.cpp
示例7:
void
MapNodeOptions::setTerrainOptions( const TerrainOptions& options )
{
_terrainOptionsConf = options.getConfig();
if ( _terrainOptions )
{
delete _terrainOptions;
_terrainOptions = 0L;
}
}
开发者ID:dreamfrog,项目名称:osgearth,代码行数:10,代码来源:MapNodeOptions.cpp
示例8: if
void
OSGTerrainEngineNode::preInitialize( const Map* map, const TerrainOptions& options )
{
TerrainEngineNode::preInitialize( map, options );
_isStreaming =
options.loadingPolicy()->mode() == LoadingPolicy::MODE_PREEMPTIVE ||
options.loadingPolicy()->mode() == LoadingPolicy::MODE_SEQUENTIAL;
// in standard mode, try to set the number of OSG DatabasePager threads to use.
if ( options.loadingPolicy().isSet() && !_isStreaming )
{
int numThreads = -1;
if ( options.loadingPolicy()->numLoadingThreads().isSet() )
{
numThreads = osg::maximum( 1, *options.loadingPolicy()->numLoadingThreads() );
}
else if ( options.loadingPolicy()->numLoadingThreadsPerCore().isSet() )
{
float numThreadsPerCore = *options.loadingPolicy()->numLoadingThreadsPerCore();
numThreads = osg::maximum( (int)1, (int)osg::round(
numThreadsPerCore * (float)OpenThreads::GetNumberOfProcessors() ) );
}
if ( numThreads > 0 )
{
OE_INFO << LC << "Requesting " << numThreads << " database pager threads in STANDARD mode" << std::endl;
osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint( numThreads );
//osg::DisplaySettings::instance()->setNumOfHttpDatabaseThreadsHint( numThreads );
}
}
}
开发者ID:spencerg,项目名称:osgearth,代码行数:33,代码来源:OSGTerrainEngineNode.cpp
示例9: mapf
void
TerrainEngineNode::preInitialize( const Map* map, const TerrainOptions& options )
{
_map = map;
// set up the CSN values
_map->getProfile()->getSRS()->populateCoordinateSystemNode( this );
// OSG's CSN likes a NULL ellipsoid to represent projected mode.
if ( !_map->isGeocentric() )
this->setEllipsoidModel( NULL );
// install the proper layer composition technique:
_texCompositor = new TextureCompositor( options );
// prime the compositor with pre-existing image layers:
MapFrame mapf(map, Map::IMAGE_LAYERS);
for( unsigned i=0; i<mapf.imageLayers().size(); ++i )
{
_texCompositor->applyMapModelChange( MapModelChange(
MapModelChange::ADD_IMAGE_LAYER,
mapf.getRevision(),
mapf.getImageLayerAt(i),
i ) );
}
// then register the callback so we can process further map model changes
_map->addMapCallback( new TerrainEngineNodeCallbackProxy( this ) );
// enable backface culling
osg::StateSet* set = getOrCreateStateSet();
set->setAttributeAndModes( new osg::CullFace( osg::CullFace::BACK ), osg::StateAttribute::ON );
// elevation uniform
_cameraElevationUniform = new osg::Uniform( osg::Uniform::FLOAT, "osgearth_CameraElevation" );
_cameraElevationUniform->set( 0.0f );
set->addUniform( _cameraElevationUniform.get() );
set->getOrCreateUniform( "osgearth_ImageLayerAttenuation", osg::Uniform::FLOAT )->set(
*options.attentuationDistance() );
_initStage = INIT_PREINIT_COMPLETE;
}
开发者ID:hulumogu,项目名称:osgearth,代码行数:43,代码来源:TerrainEngineNode.cpp
示例10: _tech
TextureCompositor::TextureCompositor(const TerrainOptions& options) :
osg::Referenced( true ),
_tech( options.compositingTechnique().value() ),
_options( options ),
_forceTech( false )
{
// for debugging:
if ( _tech == TerrainOptions::COMPOSITING_AUTO && ::getenv( "OSGEARTH_COMPOSITOR_TECH" ) )
{
TerrainOptions::CompositingTechnique oldTech = _tech;
std::string t( ::getenv( "OSGEARTH_COMPOSITOR_TECH" ) );
if ( t == "TEXTURE_ARRAY" ) _tech = TerrainOptions::COMPOSITING_TEXTURE_ARRAY;
else if ( t == "MULTITEXTURE_GPU" ) _tech = TerrainOptions::COMPOSITING_MULTITEXTURE_GPU;
else if ( t == "MULTIPASS" ) _tech = TerrainOptions::COMPOSITING_MULTIPASS;
if ( oldTech != _tech )
_forceTech = true;
}
init();
}
开发者ID:dgraves,项目名称:osgearth,代码行数:20,代码来源:TextureCompositor.cpp
示例11: if
void
OSGTerrainEngineNode::preInitialize( const Map* map, const TerrainOptions& options )
{
TerrainEngineNode::preInitialize( map, options );
_isStreaming =
options.loadingPolicy()->mode() == LoadingPolicy::MODE_PREEMPTIVE ||
options.loadingPolicy()->mode() == LoadingPolicy::MODE_SEQUENTIAL;
// in standard mode, try to set the number of OSG DatabasePager threads to use.
if ( options.loadingPolicy().isSet() && !_isStreaming )
{
int numThreads = -1;
if ( options.loadingPolicy()->numLoadingThreads().isSet() )
{
numThreads = osg::maximum( 1, *options.loadingPolicy()->numLoadingThreads() );
}
else if ( options.loadingPolicy()->numLoadingThreadsPerCore().isSet() )
{
float numThreadsPerCore = *options.loadingPolicy()->numLoadingThreadsPerCore();
numThreads = osg::maximum( (int)1, (int)osg::round(
numThreadsPerCore * (float)OpenThreads::GetNumberOfProcessors() ) );
}
if ( numThreads > 0 )
{
// NOTE: this doesn't work. the pager gets created before we ever get here.
numThreads = osg::maximum(numThreads, 2);
int numHttpThreads = osg::clampBetween( numThreads/2, 1, numThreads-1 );
//OE_INFO << LC << "Requesting pager threads in STANDARD mode: local=" << numThreads << ", http=" << numHttpThreads << std::endl;
osg::DisplaySettings::instance()->setNumOfDatabaseThreadsHint( numThreads );
osg::DisplaySettings::instance()->setNumOfHttpDatabaseThreadsHint( numHttpThreads );
}
}
}
开发者ID:JohnDr,项目名称:osgearth,代码行数:37,代码来源:OSGTerrainEngineNode.cpp
示例12:
TextureCompositorTexArray::TextureCompositorTexArray( const TerrainOptions& options ) :
_lodTransitionTime( *options.lodTransitionTime() )
{
//nop
}
开发者ID:hulumogu,项目名称:osgearth,代码行数:5,代码来源:TextureCompositorTexArray.cpp
示例13: layerOptions
void GlobePlugin::setupMap()
{
QSettings settings;
/*
QString cacheDirectory = settings.value( "cache/directory", QgsApplication::qgisSettingsDirPath() + "cache" ).toString();
TMSCacheOptions cacheOptions;
cacheOptions.setPath( cacheDirectory.toStdString() );
*/
MapOptions mapOptions;
//mapOptions.cache() = cacheOptions;
osgEarth::Map *map = new osgEarth::Map( mapOptions );
//Default image layer
/*
GDALOptions driverOptions;
driverOptions.url() = QDir::cleanPath( QgsApplication::pkgDataPath() + "/globe/world.tif" ).toStdString();
ImageLayerOptions layerOptions( "world", driverOptions );
map->addImageLayer( new osgEarth::ImageLayer( layerOptions ) );
*/
TMSOptions imagery;
imagery.url() = "http://readymap.org/readymap/tiles/1.0.0/7/";
map->addImageLayer( new ImageLayer( "Imagery", imagery ) );
MapNodeOptions nodeOptions;
//nodeOptions.proxySettings() =
//nodeOptions.enableLighting() = false;
//LoadingPolicy loadingPolicy( LoadingPolicy::MODE_SEQUENTIAL );
TerrainOptions terrainOptions;
//terrainOptions.loadingPolicy() = loadingPolicy;
terrainOptions.compositingTechnique() = TerrainOptions::COMPOSITING_MULTITEXTURE_FFP;
//terrainOptions.lodFallOff() = 6.0;
nodeOptions.setTerrainOptions( terrainOptions );
// The MapNode will render the Map object in the scene graph.
mMapNode = new osgEarth::MapNode( map, nodeOptions );
mRootNode = new osg::Group();
mRootNode->addChild( mMapNode );
// Add layers to the map
imageLayersChanged();
elevationLayersChanged();
// model placement utils
#ifdef HAVE_OSGEARTH_ELEVATION_QUERY
#else
mElevationManager = new osgEarth::Util::ElevationManager( mMapNode->getMap() );
mElevationManager->setTechnique( osgEarth::Util::ElevationManager::TECHNIQUE_GEOMETRIC );
mElevationManager->setMaxTilesToCache( 50 );
mObjectPlacer = new osgEarth::Util::ObjectPlacer( mMapNode );
// place 3D model on point layer
if ( mSettingsDialog->modelLayer() && !mSettingsDialog->modelPath().isEmpty() )
{
osg::Node* model = osgDB::readNodeFile( mSettingsDialog->modelPath().toStdString() );
if ( model )
{
QgsVectorLayer* layer = mSettingsDialog->modelLayer();
QgsFeatureIterator fit = layer->getFeatures( QgsFeatureRequest().setSubsetOfAttributes( QgsAttributeList() ) ); //TODO: select only visible features
QgsFeature feature;
while ( fit.nextFeature( feature ) )
{
QgsPoint point = feature.geometry()->asPoint();
placeNode( model, point.y(), point.x() );
}
}
}
#endif
}
开发者ID:alextheleritis,项目名称:QGIS,代码行数:73,代码来源:globe_plugin.cpp
注:本文中的TerrainOptions类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论