summaryrefslogtreecommitdiff
path: root/include/llmr/renderer/line_bucket.hpp
blob: 4c75fd38f65c50f4b242f61604a09a8729445079 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef LLMR_RENDERER_LINEBUCKET
#define LLMR_RENDERER_LINEBUCKET

#include "bucket.hpp"
#include <llmr/style/bucket_description.hpp>

#include <vector>

namespace llmr {

class Style;
class LineBuffer;
struct Coordinate;
struct pbf;

class LineBucket : public Bucket {
public:
    LineBucket(const std::shared_ptr<LineBuffer>& buffer, const BucketDescription& bucket_desc);

    virtual void render(Painter& painter, const std::string& layer_name, const Tile::ID& id);

    void addGeometry(pbf& data);
    void addGeometry(const std::vector<Coordinate>& line);
    uint32_t size() const;

    void bind();
    char *vertexOffset() const;

public:
    const BucketGeometryDescription geometry;

private:
    std::shared_ptr<LineBuffer> buffer;
    uint32_t start;
    uint32_t length;
};

}

#endif