summaryrefslogtreecommitdiff
path: root/src/mbgl/style/bucket_parameters.hpp
blob: 9aad35dcad4b49e87ad767e9930f1b6b4a9c06eb (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
#pragma once

#include <mbgl/map/mode.hpp>
#include <mbgl/tile/tile_id.hpp>
#include <mbgl/style/filter.hpp>

#include <atomic>
#include <functional>

namespace mbgl {

class TileID;
class GeometryTileLayer;
class GeometryTileFeature;
class GlyphAtlas;
class CollisionTile;
class FeatureIndex;

namespace style {

class BucketParameters {
public:
    BucketParameters(const OverscaledTileID& tileID_,
                          const GeometryTileLayer& layer_,
                          const std::atomic<bool>& obsolete_,
                          uintptr_t tileUID_,
                          GlyphAtlas& glyphAtlas_,
                          FeatureIndex& featureIndex_,
                          const MapMode mode_)
        : tileID(tileID_),
          layer(layer_),
          obsolete(obsolete_),
          tileUID(tileUID_),
          glyphAtlas(glyphAtlas_),
          featureIndex(featureIndex_),
          mode(mode_) {}

    bool cancelled() const {
        return obsolete;
    }

    void eachFilteredFeature(const Filter&, std::function<void (const GeometryTileFeature&, std::size_t index, const std::string& layerName)>);

    const OverscaledTileID& tileID;
    const GeometryTileLayer& layer;
    const std::atomic<bool>& obsolete;
    uintptr_t tileUID;
    GlyphAtlas& glyphAtlas;
    FeatureIndex& featureIndex;
    const MapMode mode;
};

} // namespace style
} // namespace mbgl