summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-04-06 17:09:21 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-04-06 17:09:21 -0700
commit6262172034a439880f219b76a4e8c272ae4a2a44 (patch)
treedbeedb85d6a0beab0ce3839838805ec22c49ce2b /include
parent760c0f0f19aa00bdec063556d76ba5cceb150e93 (diff)
parentc73309ef5f375956ec39cb6460f61b078536113b (diff)
downloadqtlocation-mapboxgl-6262172034a439880f219b76a4e8c272ae4a2a44.tar.gz
Merge pull request #1200 from mapbox/source
Eliminate StyleSource
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/annotation.hpp55
-rw-r--r--include/mbgl/map/map.hpp6
-rw-r--r--include/mbgl/map/tile.hpp90
-rw-r--r--include/mbgl/map/transform_state.hpp7
4 files changed, 5 insertions, 153 deletions
diff --git a/include/mbgl/map/annotation.hpp b/include/mbgl/map/annotation.hpp
deleted file mode 100644
index efd91d9087..0000000000
--- a/include/mbgl/map/annotation.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef MBGL_MAP_ANNOTATIONS
-#define MBGL_MAP_ANNOTATIONS
-
-#include <mbgl/map/tile.hpp>
-#include <mbgl/util/geo.hpp>
-#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/std.hpp>
-#include <mbgl/util/vec.hpp>
-
-#include <string>
-#include <vector>
-#include <mutex>
-#include <memory>
-#include <unordered_map>
-#include <unordered_set>
-
-namespace mbgl {
-
-class Annotation;
-class Map;
-class LiveTile;
-
-using AnnotationIDs = std::vector<uint32_t>;
-
-class AnnotationManager : private util::noncopyable {
-public:
- AnnotationManager();
- ~AnnotationManager();
-
- void setDefaultPointAnnotationSymbol(const std::string& symbol);
- std::pair<std::vector<Tile::ID>, AnnotationIDs> addPointAnnotations(
- const std::vector<LatLng>&, const std::vector<std::string>& symbols, const Map&);
- std::vector<Tile::ID> removeAnnotations(const AnnotationIDs&, const Map&);
- AnnotationIDs getAnnotationsInBounds(const LatLngBounds&, const Map&) const;
- LatLngBounds getBoundsForAnnotations(const AnnotationIDs&) const;
-
- const LiveTile* getTile(Tile::ID const& id);
-
- static const std::string layerID;
-
-private:
- inline uint32_t nextID();
- static vec2<double> projectPoint(const LatLng& point);
-
-private:
- mutable std::mutex mtx;
- std::string defaultPointAnnotationSymbol;
- std::unordered_map<uint32_t, std::unique_ptr<Annotation>> annotations;
- std::unordered_map<Tile::ID, std::pair<std::unordered_set<uint32_t>, std::unique_ptr<LiveTile>>, Tile::ID::Hash> tiles;
- uint32_t nextID_ = 0;
-};
-
-}
-
-#endif
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 764ff24ed8..129d463b25 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -30,7 +30,6 @@ class LayerDescription;
class Sprite;
class Style;
class StyleLayer;
-class StyleSource;
class TexturePool;
class FileSource;
class View;
@@ -175,7 +174,6 @@ private:
void setup();
void updateTiles();
- void updateSources();
// Triggered by triggerUpdate();
void update();
@@ -194,7 +192,7 @@ private:
void processTasks();
- void updateAnnotationTiles(const std::vector<Tile::ID>&);
+ void updateAnnotationTiles(const std::vector<TileID>&);
enum class Mode : uint8_t {
None, // we're not doing any processing
@@ -249,8 +247,6 @@ private:
const std::unique_ptr<MapData> data;
- std::set<util::ptr<StyleSource>> activeSources;
-
std::atomic<UpdateType> updated;
std::mutex mutexTask;
diff --git a/include/mbgl/map/tile.hpp b/include/mbgl/map/tile.hpp
deleted file mode 100644
index 146ebe6ad7..0000000000
--- a/include/mbgl/map/tile.hpp
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef MBGL_MAP_TILE
-#define MBGL_MAP_TILE
-
-#include <mbgl/util/mat4.hpp>
-#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/ptr.hpp>
-
-#include <cstdint>
-#include <bitset>
-#include <cmath>
-#include <cstdint>
-#include <forward_list>
-#include <iosfwd>
-#include <string>
-#include <functional>
-
-namespace mbgl {
-
-class TileData;
-struct box;
-
-struct ClipID {
- inline ClipID() {}
- inline ClipID(const std::string &mask_, const std::string &reference_) : mask(mask_), reference(reference_) {}
-
- std::bitset<8> mask;
- std::bitset<8> reference;
-
- inline bool operator==(const ClipID &other) const {
- return mask == other.mask && reference == other.reference;
- }
-};
-
-class Tile : private util::noncopyable {
-public:
- struct ID {
- const int16_t w = 0;
- const int8_t z = 0;
- const int32_t x = 0, y = 0;
-
- inline explicit ID(int8_t z_, int32_t x_, int32_t y_)
- : w((x_ < 0 ? x_ - (1 << z_) + 1 : x_) / (1 << z_)), z(z_), x(x_), y(y_) {}
-
- inline uint64_t to_uint64() const {
- return ((std::pow(2, z) * y + x) * 32) + z;
- }
-
- struct Hash {
- std::size_t operator()(ID const& i) const {
- return std::hash<uint64_t>()(i.to_uint64());
- }
- };
-
- inline bool operator==(const ID& rhs) const {
- return w == rhs.w && z == rhs.z && x == rhs.x && y == rhs.y;
- }
-
- inline bool operator!=(const ID& rhs) const {
- return !operator==(rhs);
- }
-
- inline bool operator<(const ID &rhs) const {
- if (w != rhs.w) return w < rhs.w;
- if (z != rhs.z) return z < rhs.z;
- if (x != rhs.x) return x < rhs.x;
- return y < rhs.y;
- }
-
- ID parent(int8_t z) const;
- ID normalized() const;
- std::forward_list<ID> children(int32_t z) const;
- bool isChildOf(const Tile::ID &id) const;
- operator std::string() const;
- };
-
- static std::forward_list<Tile::ID> cover(int8_t z, const box& bounds);
-
-public:
- explicit Tile(const ID& id);
-
-public:
- const Tile::ID id;
- ClipID clip;
- mat4 matrix;
- util::ptr<TileData> data;
-};
-
-}
-
-#endif
diff --git a/include/mbgl/map/transform_state.hpp b/include/mbgl/map/transform_state.hpp
index c1a324a899..f6a00a4a3d 100644
--- a/include/mbgl/map/transform_state.hpp
+++ b/include/mbgl/map/transform_state.hpp
@@ -1,8 +1,6 @@
#ifndef MBGL_MAP_TRANSFORM_STATE
#define MBGL_MAP_TRANSFORM_STATE
-#include <mbgl/map/tile.hpp>
-
#include <mbgl/util/mat4.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/vec.hpp>
@@ -13,12 +11,15 @@
namespace mbgl {
+class TileID;
+struct box;
+
class TransformState {
friend class Transform;
public:
// Matrix
- void matrixFor(mat4& matrix, const Tile::ID& id) const;
+ void matrixFor(mat4& matrix, const TileID& id) const;
box cornersToBox(uint32_t z) const;
// Dimensions