summaryrefslogtreecommitdiff
path: root/src/mbgl/tile/geometry_tile_data.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-05-19 16:55:29 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-06-10 12:42:14 +0200
commit46b0ebcd3cad1a33a2a70c6e93b885d3be6be9fa (patch)
treebe52ae1d20fd8fef2db7c36cbe356af0db313e9d /src/mbgl/tile/geometry_tile_data.hpp
parent99b1df4e46e7fc110d479bc3efeb169e787e1c5e (diff)
downloadqtlocation-mapboxgl-46b0ebcd3cad1a33a2a70c6e93b885d3be6be9fa.tar.gz
[core] rename VectorTileData => GeometryTileData
Diffstat (limited to 'src/mbgl/tile/geometry_tile_data.hpp')
-rw-r--r--src/mbgl/tile/geometry_tile_data.hpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp
new file mode 100644
index 0000000000..00d919a8a6
--- /dev/null
+++ b/src/mbgl/tile/geometry_tile_data.hpp
@@ -0,0 +1,74 @@
+#pragma once
+
+#include <mbgl/tile/tile_data.hpp>
+#include <mbgl/tile/tile_worker.hpp>
+#include <mbgl/text/placement_config.hpp>
+#include <mbgl/util/atomic.hpp>
+#include <mbgl/util/feature.hpp>
+
+#include <memory>
+#include <unordered_map>
+
+namespace mbgl {
+
+class AsyncRequest;
+class GeometryTileSource;
+class FeatureIndex;
+
+namespace style {
+class Style;
+}
+
+class GeometryTileData : public TileData {
+public:
+ GeometryTileData(const OverscaledTileID&,
+ std::unique_ptr<GeometryTileSource> tileSource,
+ std::string sourceID,
+ style::Style&,
+ const MapMode,
+ const std::function<void(std::exception_ptr)>& callback);
+
+ ~GeometryTileData();
+
+ Bucket* getBucket(const style::Layer&) override;
+
+ bool parsePending(std::function<void(std::exception_ptr)> callback) override;
+
+ void redoPlacement(PlacementConfig config, const std::function<void()>&) override;
+ void redoPlacement(const std::function<void()>&) override;
+
+ void queryRenderedFeatures(
+ std::unordered_map<std::string, std::vector<Feature>>& result,
+ const GeometryCoordinates& queryGeometry,
+ const TransformState&,
+ const optional<std::vector<std::string>>& layerIDs) override;
+
+ void cancel() override;
+
+private:
+ style::Style& style;
+ Worker& worker;
+ TileWorker tileWorker;
+
+ std::unique_ptr<AsyncRequest> tileRequest;
+ std::unique_ptr<AsyncRequest> workRequest;
+
+ // Contains all the Bucket objects for the tile. Buckets are render
+ // objects and they get added by tile parsing operations.
+ std::unordered_map<std::string, std::unique_ptr<Bucket>> buckets;
+
+ std::unique_ptr<FeatureIndex> featureIndex;
+ std::unique_ptr<const GeometryTile> geometryTile;
+
+ // Stores the placement configuration of the text that is currently placed on the screen.
+ PlacementConfig placedConfig;
+
+ // Stores the placement configuration of how the text should be placed. This isn't necessarily
+ // the one that is being displayed.
+ PlacementConfig targetConfig;
+
+ // Used to signal the worker that it should abandon parsing this tile as soon as possible.
+ util::Atomic<bool> obsolete { false };
+};
+
+} // namespace mbgl