#ifndef LLMR_MAP_TILE_DATA #define LLMR_MAP_TILE_DATA #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace llmr { class Style; class Raster; class Bucket; class LayerDescription; class BucketDescription; class FillVertexBuffer; class LineVertexBuffer; class PointVertexBuffer; class TextVertexBuffer; class TriangleElementsBuffer; class LineElementsBuffer; class PointElementsBuffer; class TextElementsBuffer; class PlainShader; class TileData : public std::enable_shared_from_this, private util::noncopyable { public: struct exception : std::exception {}; struct geometry_too_long_exception : exception {}; public: typedef std::shared_ptr Ptr; enum class State { invalid, initial, loading, loaded, parsed, obsolete }; public: TileData(Tile::ID id, const Style& style, GlyphAtlas& glyphAtlas, const bool use_raster = false, const bool use_retina = false); ~TileData(); void request(); bool parse(); void cancel(); const std::string toString() const; public: const Tile::ID id; const bool use_raster; const bool use_retina; std::atomic state; std::shared_ptr raster; // Holds the actual geometries in this tile. DebugFontBuffer debugFontBuffer; VertexArrayObject debugFontArray; std::shared_ptr fillVertexBuffer; std::shared_ptr lineVertexBuffer; std::shared_ptr pointVertexBuffer; std::shared_ptr textVertexBuffer; std::shared_ptr triangleElementsBuffer; std::shared_ptr lineElementsBuffer; std::shared_ptr pointElementsBuffer; // Holds the buckets of this tile. // They contain the location offsets in the buffers stored above std::map> buckets; private: // Source data std::string data; const Style& style; GlyphAtlas& glyphAtlas; platform::Request *req = nullptr; }; } #endif