diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-05-09 18:10:28 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-05-09 18:10:28 +0200 |
commit | 0bfd7b0f430d51dd5661d69876ac5294616d128f (patch) | |
tree | 0a1b706049246a4152dec605b8193b223b81d170 /include/llmr/map/vector_tile_data.hpp | |
parent | 70a7ba81f33d88991d21534b68600d470ad2b798 (diff) | |
download | qtlocation-mapboxgl-0bfd7b0f430d51dd5661d69876ac5294616d128f.tar.gz |
Calculate clip IDs with a huffman prefix tree
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
Diffstat (limited to 'include/llmr/map/vector_tile_data.hpp')
-rw-r--r-- | include/llmr/map/vector_tile_data.hpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/llmr/map/vector_tile_data.hpp b/include/llmr/map/vector_tile_data.hpp new file mode 100644 index 0000000000..6deae7bd7a --- /dev/null +++ b/include/llmr/map/vector_tile_data.hpp @@ -0,0 +1,50 @@ +#ifndef LLMR_MAP_VECTOR_TILE_DATA +#define LLMR_MAP_VECTOR_TILE_DATA + +#include <llmr/map/tile_data.hpp> + + +#include <llmr/renderer/bucket.hpp> + +#include <llmr/geometry/vertex_buffer.hpp> +#include <llmr/geometry/elements_buffer.hpp> +#include <llmr/geometry/fill_buffer.hpp> +#include <llmr/geometry/line_buffer.hpp> +#include <llmr/geometry/point_buffer.hpp> +#include <llmr/geometry/text_buffer.hpp> + +#include <map> + +namespace llmr { + + +class VectorTileData : public TileData { + friend class TileParser; + +public: + VectorTileData(Tile::ID id, Map &map, const std::string url); + ~VectorTileData(); + + virtual void parse(); + virtual void render(Painter &painter, const LayerDescription& layer_desc); + +protected: + // Holds the actual geometries in this tile. + FillVertexBuffer fillVertexBuffer; + LineVertexBuffer lineVertexBuffer; + PointVertexBuffer pointVertexBuffer; + TextVertexBuffer textVertexBuffer; + + TriangleElementsBuffer triangleElementsBuffer; + LineElementsBuffer lineElementsBuffer; + PointElementsBuffer pointElementsBuffer; + + // Holds the buckets of this tile. + // They contain the location offsets in the buffers stored above + std::map<std::string, std::unique_ptr<Bucket>> buckets; + +}; + +} + +#endif |