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


C++ MapInfo::getProfile方法代码示例

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


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

示例1:

void
TerrainEngineNode::onMapInfoEstablished( const MapInfo& mapInfo )
{
    // set up the CSN values   
    mapInfo.getProfile()->getSRS()->populateCoordinateSystemNode( this );
    
    // OSG's CSN likes a NULL ellipsoid to represent projected mode.
    if ( !mapInfo.isGeocentric() )
        this->setEllipsoidModel( NULL );
}
开发者ID:flybpc,项目名称:osgearth,代码行数:10,代码来源:TerrainEngineNode.cpp

示例2: getTile

// This method is called by StreamingTerrainNode::traverse() in the UPDATE TRAVERSAL.
void
StreamingTerrainNode::refreshFamily(const MapInfo&           mapInfo,
                                    const TileKey&           key,
                                    StreamingTile::Relative* family,
                                    bool                     tileTableLocked )
{
    osgTerrain::TileID tileId = key.getTileId();

    // geocentric maps wrap around in the X dimension.
    bool wrapX = mapInfo.isGeocentric();
    unsigned int tileCountX, tileCountY;
    mapInfo.getProfile()->getNumTiles( tileId.level, tileCountX, tileCountY );

    // Relative::PARENT
    {
        family[StreamingTile::Relative::PARENT].expected = true; // TODO: is this always correct?
        family[StreamingTile::Relative::PARENT].elevLOD = -1;
        family[StreamingTile::Relative::PARENT].imageLODs.clear();
        family[StreamingTile::Relative::PARENT].tileID = osgTerrain::TileID( tileId.level-1, tileId.x/2, tileId.y/2 );

        osg::ref_ptr<StreamingTile> parent;
        getTile( family[StreamingTile::Relative::PARENT].tileID, parent, !tileTableLocked );
        if ( parent.valid() )
        {
            family[StreamingTile::Relative::PARENT].elevLOD = parent->getElevationLOD();

            ColorLayersByUID relLayers;
            parent->getCustomColorLayers( relLayers );

            for( ColorLayersByUID::const_iterator i = relLayers.begin(); i != relLayers.end(); ++i )
            {
                family[StreamingTile::Relative::PARENT].imageLODs[i->first] = i->second.getLevelOfDetail();
            }
        }
    }

    // Relative::WEST
    {
        family[StreamingTile::Relative::WEST].expected = tileId.x > 0 || wrapX;
        family[StreamingTile::Relative::WEST].elevLOD = -1;
        family[StreamingTile::Relative::WEST].imageLODs.clear();
        family[StreamingTile::Relative::WEST].tileID = osgTerrain::TileID( tileId.level, tileId.x > 0? tileId.x-1 : tileCountX-1, tileId.y );
        osg::ref_ptr<StreamingTile> west;
        getTile( family[StreamingTile::Relative::WEST].tileID, west, !tileTableLocked );
        if ( west.valid() )
        {
            family[StreamingTile::Relative::WEST].elevLOD = west->getElevationLOD();

            ColorLayersByUID relLayers;
            west->getCustomColorLayers( relLayers );

            for( ColorLayersByUID::const_iterator i = relLayers.begin(); i != relLayers.end(); ++i )
            {
                family[StreamingTile::Relative::WEST].imageLODs[i->first] = i->second.getLevelOfDetail();
            }
        }
    }

    // Relative::NORTH
    {
        family[StreamingTile::Relative::NORTH].expected = tileId.y < (int)tileCountY-1;
        family[StreamingTile::Relative::NORTH].elevLOD = -1;
        family[StreamingTile::Relative::NORTH].imageLODs.clear();
        family[StreamingTile::Relative::NORTH].tileID = osgTerrain::TileID( tileId.level, tileId.x, tileId.y < (int)tileCountY-1 ? tileId.y+1 : 0 );
        osg::ref_ptr<StreamingTile> north;
        getTile( family[StreamingTile::Relative::NORTH].tileID, north, !tileTableLocked );
        if ( north.valid() )
        {
            family[StreamingTile::Relative::NORTH].elevLOD = north->getElevationLOD();

            ColorLayersByUID relLayers;
            north->getCustomColorLayers( relLayers );

            for( ColorLayersByUID::const_iterator i = relLayers.begin(); i != relLayers.end(); ++i )
            {
                family[StreamingTile::Relative::NORTH].imageLODs[i->first] = i->second.getLevelOfDetail();
            }
        }
    }

    // Relative::EAST
    {
        family[StreamingTile::Relative::EAST].expected = tileId.x < (int)tileCountX-1 || wrapX;
        family[StreamingTile::Relative::EAST].elevLOD = -1;
        family[StreamingTile::Relative::EAST].imageLODs.clear();
        family[StreamingTile::Relative::EAST].tileID = osgTerrain::TileID( tileId.level, tileId.x < (int)tileCountX-1 ? tileId.x+1 : 0, tileId.y );
        osg::ref_ptr<StreamingTile> east;
        getTile( family[StreamingTile::Relative::EAST].tileID, east, !tileTableLocked );
        if ( east.valid() )
        {
            family[StreamingTile::Relative::EAST].elevLOD = east->getElevationLOD();

            ColorLayersByUID relLayers;
            east->getCustomColorLayers( relLayers );

            for( ColorLayersByUID::const_iterator i = relLayers.begin(); i != relLayers.end(); ++i )
            {
                family[StreamingTile::Relative::EAST].imageLODs[i->first] = i->second.getLevelOfDetail();
            }
//.........这里部分代码省略.........
开发者ID:airwzz999,项目名称:osgearth-for-android,代码行数:101,代码来源:StreamingTerrainNode.cpp


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