目标:(十二)中问题13
是Map的时间快照,如注释所说的那样:
/**
* A "snapshot in time" of a Map model revision. Use this class to get a safe "copy" of
* the map model lists that you can use without worrying about the model changing underneath
* you from another thread.
*/
class OSGEARTH_EXPORT MapFrame
osgEarth::MapFrame,是对Map的更高一级封装,经过MpaFrame包装Map可以监控地图图层的变化情况。
对地图进行了一层封装,能够管理地图的版本号、影像层、高层层等。MapFrame的版本号的含义主要是用来判断是否与Map的版本号一致,如果不一致就需要对MapFram和Map进行同步。
osgEarth/MapFrame.cpp
bool
MapFrame::needsSync() const
{
if ( !isValid() )
return false;
osg::ref_ptr<const Map> map;
return
_map.lock(map) &&
(map->getDataModelRevision() != _mapDataModelRevision || !_initialized);
}
使用的场合:
1、计算瓦片包围盒时,包围盒回调函数会放入rex引擎的上下文环境中,供使用
osgEarthDrivers/engine_rex/RexTerrainEngineNode.cpp
void
RexTerrainEngineNode::setMap(const Map* map, const TerrainOptions& options)
{
_modifyBBoxCallback = new ModifyBoundingBoxCallback(_mapFrame);
_engineContext = new EngineContext(
getMap(),
this, // engine
_geometryPool.get(),
_loader.get(),
_unloader.get(),
_rasterizer,
_liveTiles.get(),
_renderBindings,
_terrainOptions,
_selectionInfo,
_modifyBBoxCallback.get());
}
osgEarthDrivers/engine_rex/TileDrawable
struct ModifyBoundingBoxCallback : public osg::Referenced
{
void operator()(const TileKey& key, osg::Boun

本文详细分析了osgEarth的Rex引擎中RexTerrainEngineNode的_mapFrame组件。MapFrame是对Map的封装,用于监控地图图层变化,管理地图版本、影像层等。它主要应用于计算瓦片包围盒和地图同步。文章列举了一系列后续要探讨的问题,涉及osgEarth的各个核心组件和功能。
RexTerrainEngineNode中_mapFrame的作用&spm=1001.2101.3001.5002&articleId=84693280&d=1&t=3&u=73b792c3e6a84928ace80bc498dd3e92)
498

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



