EMODnet Quantized Mesh Generator for Cesium
Public Member Functions | List of all members
ZoomTilesBorderVerticesCache Class Reference

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>

Public Member Functions

 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ZoomTilesBorderVerticesCache() [1/2]

ZoomTilesBorderVerticesCache::ZoomTilesBorderVerticesCache ( const ctb::TileBounds &  zoomBounds,
const int &  tileMaxCoord 
)
inline

Constructor

Parameters
zoomBoundsThe bounds of the current zoom
tileMaxCoordThe number of pixels in a tile

◆ ZoomTilesBorderVerticesCache() [2/2]

ZoomTilesBorderVerticesCache::ZoomTilesBorderVerticesCache ( )
inline

Default Constructor

Member Function Documentation

◆ canTileStartProcessing()

bool ZoomTilesBorderVerticesCache::canTileStartProcessing ( const int &  tileX,
const int &  tileY 
)

Checks if a tile can start processing.

Parameters
tileXX coordinate of the tile
tileYY 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
tileXThe X coordinate of the tile to construct
tileYThe Y coordinate of the tile to construct
bdTile'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
tileXX coordinate of the tile
tileYY 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
tileIndTile 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
tileIndTile 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
tileXThe X coordinate of the tile
tileYThe Y coordinate of the tile
easternVerticesToPreserveEastern vertices to preserve for the tile
westernVerticesToPreserveWestern vertices to preserve for the tile
northernVerticesToPreserveSouthern vertices to preserve for the tile
southernVerticesToPreserveNorthern vertices to preserve for the tile
Returns

The documentation for this class was generated from the following files: