#ifndef LLMR_MAP_TILE_PARSER #define LLMR_MAP_TILE_PARSER #include #include #include #include #include namespace llmr { class Style; class GlyphAtlas; class GlyphStore; class SpriteAtlas; class VectorTileData; class LayerDescription; class Bucket; class TileParser { public: TileParser(const std::string &data, VectorTileData &tile, const std::shared_ptr &style, const std::shared_ptr &glyphAtlas, const std::shared_ptr &glyphStore, const std::shared_ptr &spriteAtlas); public: void parse(); private: bool obsolete() const; void parseGlyphs(); void parseStyleLayers(const std::vector& layers); void addGlyph(uint64_t tileid, const std::string stackname, const std::u32string &string, const FontStack &fontStack, GlyphAtlas &glyphAtlas, GlyphPositions &face); std::unique_ptr createBucket(const BucketDescription& bucket_desc); std::unique_ptr createFillBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc); std::unique_ptr createLineBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc); std::unique_ptr createIconBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc); std::unique_ptr createTextBucket(const VectorTileLayer& layer, const BucketDescription& bucket_desc); template void addBucketFeatures(Bucket& bucket, const VectorTileLayer& layer, const BucketDescription& bucket_desc); template void addBucketFeatures(Bucket& bucket, const VectorTileLayer& layer, const BucketDescription& bucket_desc, Args&& ...args); private: const VectorTile vector_data; VectorTileData& tile; // Cross-thread shared data. std::shared_ptr style; std::shared_ptr glyphAtlas; std::shared_ptr glyphStore; std::shared_ptr spriteAtlas; Placement placement; }; } #endif