blob: 2992d77109dd2d47bc843cdaae8152ae00055c62 (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#ifndef LLMR_RENDERER_FILLBUCKET
#define LLMR_RENDERER_FILLBUCKET
#include "bucket.hpp"
#include <llmr/style/bucket_description.hpp>
#include <llmr/geometry/vao.hpp>
#include <llmr/geometry/fill_buffer.hpp>
#include <vector>
#include <memory>
#ifndef BUFFER_OFFSET
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
#endif
namespace llmr {
class Style;
class FillVertexBuffer;
class FillElementsBuffer;
class BucketDescription;
class OutlineShader;
class PlainShader;
struct Coordinate;
struct pbf;
class FillBucket : public Bucket {
public:
FillBucket(const std::shared_ptr<FillVertexBuffer>& vertexBuffer,
const std::shared_ptr<FillElementsBuffer>& elementsBuffer,
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 drawElements(PlainShader& shader);
void drawVertices(OutlineShader& shader);
public:
const BucketGeometryDescription geom_desc;
private:
std::shared_ptr<FillVertexBuffer> vertexBuffer;
std::shared_ptr<FillElementsBuffer> elementsBuffer;
struct group {
VertexArrayObject<PlainShader> array;
uint32_t vertex_length;
uint32_t elements_length;
group() : vertex_length(0), elements_length(0) {}
group(uint32_t vertex_length, uint32_t elements_length)
: vertex_length(vertex_length),
elements_length(elements_length) {
}
};
// hold information on where the vertices are located in the FillBuffer
uint32_t vertex_start;
uint32_t elements_start;
uint32_t length;
VertexArrayObject<OutlineShader> array;
std::vector<group> groups;
};
}
#endif
|