目标:(十二)中的问题18
翻译为活跃瓦片注册表应该更合适
RexTerrainEngineNode中的_liveTiles是osgEarth::Drivers::RexTerrainEngine::TileNodeRegistry,在setMap时创建这个_liveTiles,并放入上下文环境,并随上下文环境在其它地方使用,比如:TileNode的create函数中
活跃瓦片寄存器负责管理各个版本瓦片节点TileNode,在rex引擎setMap时会创建这个寄存器。在TileNode执行create时,会将此瓦片加入到活跃瓦片寄存器中。添加到活跃瓦片注册表时会执行一系列操作:
osgEarthDrivers/engine_rex/TileNodeRegistry.cpp
void
TileNodeRegistry::addSafely(TileNode* tile)
{
_tiles.insert( tile->getKey(), tile );
//_tiles[ tile->getTileKey() ] = tile;
if ( _revisioningEnabled )
tile->setMapRevision( _maprev );
// Start waiting on our neighbors
startListeningFor(tile->getKey().createNeighborKey(1, 0), tile);
startListeningFor(tile->getKey().createNeighborKey(0, 1), tile);
// check for tiles that are waiting on this tile, and notify them!
TileKeyOneToMany::iterator notifier = _notifiers.find( tile->getKey() );
if ( notifier != _noti

本文详细分析了osgEarth的Rex引擎中活跃瓦片寄存器的作用,包括其在管理不同版本瓦片节点、监听相邻瓦片加载以及在分页瓦片卸载中的功能。活跃瓦片寄存器维护了一个随机访问表,用于快速查找和计数,并在瓦片加载和卸载时确保正确同步。
最低0.47元/天 解锁文章
690

被折叠的 条评论
为什么被折叠?



