Files
MapLibreParticleLab/include/llmr/map/vector_tile_data.hpp
Konstantin Käfer 0bfd7b0f43 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
2014-05-09 18:10:28 +02:00

51 lines
1.2 KiB
C++

#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