コード例 #1
0
ファイル: qgsterraintileloader_p.cpp プロジェクト: CS-SI/QGIS
QgsTerrainTileLoader::QgsTerrainTileLoader( QgsTerrainEntity *terrain, QgsChunkNode *node )
  : QgsChunkLoader( node )
  , mTerrain( terrain )
{
  const Qgs3DMapSettings &map = mTerrain->map3D();
  int tx, ty, tz;
#if 0
  if ( map.terrainGenerator->type() == TerrainGenerator::QuantizedMesh )
  {
    // TODO: sort out - should not be here
    QuantizedMeshTerrainGenerator *generator = static_cast<QuantizedMeshTerrainGenerator *>( map.terrainGenerator.get() );
    generator->quadTreeTileToBaseTile( node->x, node->y, node->z, tx, ty, tz );
  }
  else
#endif
  {
    tx = node->tileX();
    ty = node->tileY();
    tz = node->tileZ();
  }

  QgsRectangle extentTerrainCrs = map.terrainGenerator()->tilingScheme().tileToExtent( tx, ty, tz );
  mExtentMapCrs = terrain->terrainToMapTransform().transformBoundingBox( extentTerrainCrs );
  mTileDebugText = QString( "%1 | %2 | %3" ).arg( tx ).arg( ty ).arg( tz );
}
コード例 #2
0
    QuantizedMeshTerrainChunkLoader( Terrain *terrain, ChunkNode *node )
      : TerrainChunkLoader( terrain, node )
      , qmt( nullptr )
    {
      const Map3D &map = mTerrain->map3D();
      QuantizedMeshTerrainGenerator *generator = static_cast<QuantizedMeshTerrainGenerator *>( map.terrainGenerator.get() );

      generator->quadTreeTileToBaseTile( node->x, node->y, node->z, tx, ty, tz );
      tileRect = map.terrainGenerator->terrainTilingScheme.tileToExtent( tx, ty, tz );

      // we need map settings here for access to mapToPixel
      mapSettings.setLayers( map.layers() );
      mapSettings.setOutputSize( QSize( map.tileTextureSize, map.tileTextureSize ) );
      mapSettings.setDestinationCrs( map.crs );
      mapSettings.setExtent( mTerrain->terrainToMapTransform().transformBoundingBox( tileRect ) );
    }