This changes the clip IDs from sequential to a huffman prefix tree, meaning that parent tiles share the same prefix with child tiles (but are shorter). This allows us to use the same checkerboard pattern to draw all tiles. TODO: - make sure we're not overflowing the 8 bit limit of the stencil buffer - draw all checkerboard fields at the same time, with one draw call - fix raster drawing (fading, clipping) refs #132
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#ifndef LLMR_MAP_TILE_PARSER
|
|
#define LLMR_MAP_TILE_PARSER
|
|
|
|
#include <llmr/map/vector_tile_data.hpp>
|
|
#include <llmr/map/vector_tile.hpp>
|
|
#include <llmr/text/placement.hpp>
|
|
|
|
namespace llmr {
|
|
|
|
class Style;
|
|
class GlyphAtlas;
|
|
|
|
class LayerDescription;
|
|
class Bucket;
|
|
|
|
class TileParser {
|
|
public:
|
|
TileParser(const std::string& data, VectorTileData& tile, const Style& style, GlyphAtlas& glyphAtlas);
|
|
|
|
private:
|
|
bool obsolete() const;
|
|
void parseGlyphs();
|
|
void parseStyleLayers(const std::vector<LayerDescription>& layers);
|
|
std::unique_ptr<Bucket> createBucket(const BucketDescription& bucket_desc);
|
|
std::unique_ptr<Bucket> createFillBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc);
|
|
std::unique_ptr<Bucket> createLineBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc);
|
|
std::unique_ptr<Bucket> createPointBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc);
|
|
std::unique_ptr<Bucket> createTextBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc);
|
|
template <class Bucket> void addBucketFeatures(Bucket& bucket, const VectorTileLayer& layer, const BucketDescription& bucket_desc);
|
|
|
|
private:
|
|
const VectorTile vector_data;
|
|
VectorTileData& tile;
|
|
const Style& style;
|
|
GlyphAtlas& glyphAtlas;
|
|
Faces faces;
|
|
Placement placement;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|