Cache to store/reuse the vertices at the borders for tiles that have been already constructed for a given zoom.
More...
#include <zoom_tiles_border_vertices_cache.h>
|
| ZoomTilesBorderVerticesCache (const ctb::TileBounds &zoomBounds, const int &tileMaxCoord) |
|
| ZoomTilesBorderVerticesCache () |
|
bool | getConstrainedBorderVerticesForTile (const int &tileX, const int &tileY, BordersData &bd) |
|
bool | setConstrainedBorderVerticesForTile (const int &tileX, const int &tileY, const std::vector< Point_3 > &easternVerticesToPreserve, const std::vector< Point_3 > &westernVerticesToPreserve, const std::vector< Point_3 > &northernVerticesToPreserve, const std::vector< Point_3 > &southernVerticesToPreserve) |
|
int | numCacheEntries () |
|
bool | isTileVisited (const int &tileX, const int &tileY) |
|
bool | isTileVisited (const std::pair< int, int > &tileInd) |
| Checks if a tile is visited. More...
|
|
bool | isTileBeingProcessed (const int &tileX, const int &tileY) |
| Checks if a tile is being processed. More...
|
|
bool | isTileBeingProcessed (const std::pair< int, int > &tileInd) |
| Checks if a tile is being processed. More...
|
|
bool | canTileStartProcessing (const int &tileX, const int &tileY) |
| Checks if a tile can start processing. More...
|
|
bool | allTilesProcessed () const |
| Checks if all the tiles in the zoom have been processed.
|
|
int | getNumProcessed () const |
| Gets the number of processed tiles.
|
|
int | getNumTiles () const |
| Gets the total amount of tiles to be processed in the zoom.
|
|
Cache to store/reuse the vertices at the borders for tiles that have been already constructed for a given zoom.
Once the information of a tile is no longer required, it is erased from this cache.
◆ ZoomTilesBorderVerticesCache() [1/2]
ZoomTilesBorderVerticesCache::ZoomTilesBorderVerticesCache |
( |
const ctb::TileBounds & |
zoomBounds, |
|
|
const int & |
tileMaxCoord |
|
) |
| |
|
inline |
Constructor
- Parameters
-
zoomBounds | The bounds of the current zoom |
tileMaxCoord | The number of pixels in a tile |
◆ ZoomTilesBorderVerticesCache() [2/2]
ZoomTilesBorderVerticesCache::ZoomTilesBorderVerticesCache |
( |
| ) |
|
|
inline |
◆ canTileStartProcessing()
bool ZoomTilesBorderVerticesCache::canTileStartProcessing |
( |
const int & |
tileX, |
|
|
const int & |
tileY |
|
) |
| |
Checks if a tile can start processing.
- Parameters
-
tileX | X coordinate of the tile |
tileY | Y coordinate of the tile |
- Returns
- boolean indicating whether a tile can start processing
◆ getConstrainedBorderVerticesForTile()
bool ZoomTilesBorderVerticesCache::getConstrainedBorderVerticesForTile |
( |
const int & |
tileX, |
|
|
const int & |
tileY, |
|
|
BordersData & |
bd |
|
) |
| |
Given a tile, it gets the border edges to preserve from already constructed tiles. It also cleans up unnecessary data and marks the tile as "being processed", so that neighboring tiles cannot start processing until this one has finished.
- Parameters
-
tileX | The X coordinate of the tile to construct |
tileY | The Y coordinate of the tile to construct |
bd | Tile's borders' data to be maintained for this tile based on the info in the cache |
◆ isTileBeingProcessed() [1/2]
bool ZoomTilesBorderVerticesCache::isTileBeingProcessed |
( |
const int & |
tileX, |
|
|
const int & |
tileY |
|
) |
| |
|
inline |
Checks if a tile is being processed.
WARNING: Does not perform bounds check for the tile
- Parameters
-
tileX | X coordinate of the tile |
tileY | Y coordinate of the tile |
- Returns
- boolean indicating whether the tile was already processed
◆ isTileBeingProcessed() [2/2]
bool ZoomTilesBorderVerticesCache::isTileBeingProcessed |
( |
const std::pair< int, int > & |
tileInd | ) |
|
|
inline |
Checks if a tile is being processed.
WARNING: Does not perform bounds check for the tile
- Parameters
-
tileInd | Tile index (a pair) |
- Returns
- boolean indicating whether the tile was already processed
◆ isTileVisited()
bool ZoomTilesBorderVerticesCache::isTileVisited |
( |
const std::pair< int, int > & |
tileInd | ) |
|
|
inline |
Checks if a tile is visited.
WARNING: Does not perform bounds check for the tile
- Parameters
-
tileInd | Tile index (a pair) |
- Returns
- boolean indicating whether the tile was already visited
◆ numCacheEntries()
int ZoomTilesBorderVerticesCache::numCacheEntries |
( |
| ) |
|
|
inline |
Get the number of cache entries
- Returns
- Number of cache entries
◆ setConstrainedBorderVerticesForTile()
bool ZoomTilesBorderVerticesCache::setConstrainedBorderVerticesForTile |
( |
const int & |
tileX, |
|
|
const int & |
tileY, |
|
|
const std::vector< Point_3 > & |
easternVerticesToPreserve, |
|
|
const std::vector< Point_3 > & |
westernVerticesToPreserve, |
|
|
const std::vector< Point_3 > & |
northernVerticesToPreserve, |
|
|
const std::vector< Point_3 > & |
southernVerticesToPreserve |
|
) |
| |
Stores the borders to preserve for a given tile in the cache. Note that the eastern/western/northern/southern vectors already include the corners, so we don't set them separately as opposed to getConstrainedBorderVerticesForTile
- Parameters
-
tileX | The X coordinate of the tile |
tileY | The Y coordinate of the tile |
easternVerticesToPreserve | Eastern vertices to preserve for the tile |
westernVerticesToPreserve | Western vertices to preserve for the tile |
northernVerticesToPreserve | Southern vertices to preserve for the tile |
southernVerticesToPreserve | Northern vertices to preserve for the tile |
- Returns
The documentation for this class was generated from the following files: