Exemplo n.º 1
0
 public TerrainDB(string bmsBaseDirectory, bool loadAllLods = false) : this()
 {
     if (bmsBaseDirectory == null)
     {
         throw new ArgumentNullException(nameof(bmsBaseDirectory));
     }
     if (!bmsBaseDirectory.EndsWith(Path.DirectorySeparatorChar.ToString()))
     {
         bmsBaseDirectory += Path.DirectorySeparatorChar;
     }
     BMSBaseDirectory = bmsBaseDirectory;
     _loadAllLods     = loadAllLods;
     _elevationPostCoordinateClamper           = new ElevationPostCoordinateClamper(this);
     _columnAndRowElevationPostRecordRetriever = new ColumnAndRowElevationPostRecordRetriever(this, _elevationPostCoordinateClamper);
     _nearTileTextureLoader   = new NearTileTextureLoader(this);
     _farTileTextureRetriever = new FarTileTextureRetriever(this);
     _theaterMapBuilder       = new TheaterMapBuilder(this);
     _distanceBetweenElevationPostsCalculator = new DistanceBetweenElevationPostsCalculator(this);
     _terrainTextureByTextureIdRetriever      = new TerrainTextureByTextureIdRetriever(this, _nearTileTextureLoader, _farTileTextureRetriever);
     _detailTextureForElevationPostRetriever  = new DetailTextureForElevationPostRetriever(this, _elevationPostCoordinateClamper, _terrainTextureByTextureIdRetriever, _columnAndRowElevationPostRecordRetriever);
     _terrainDotBilFileReader = new TerrainDotBilFileReader();
     _terrainDotTidFileReader = new TerrainDotTidFileReader();
     _nearestElevationPostColumnAndRowCalculator = new NearestElevationPostColumnAndRowCalculator(this, _distanceBetweenElevationPostsCalculator, _elevationPostCoordinateClamper);
     _terrainHeightCalculator  = new TerrainHeightCalculator(this, _columnAndRowElevationPostRecordRetriever, _distanceBetweenElevationPostsCalculator, _nearestElevationPostColumnAndRowCalculator);
     _latLongCalculator        = new LatLongCalculator(this);
     _tileSetConfigValueReader = new TileSetConfigValueReader(bmsBaseDirectory);
 }
 public TerrainTextureByTextureIdRetriever(
     TerrainDB terrainDB,
     INearTileTextureLoader nearTileTextureLoader     = null,
     IFarTileTextureRetriever farTileTextureRetriever = null)
 {
     _terrainDB               = terrainDB;
     _nearTileTextureLoader   = nearTileTextureLoader ?? new NearTileTextureLoader(_terrainDB);
     _farTileTextureRetriever = farTileTextureRetriever ?? new FarTileTextureRetriever(_terrainDB);
 }