#ifndef MBGL_MAP_SOURCE #define MBGL_MAP_SOURCE #include #include #include #include #include #include #include #include #include #include #include namespace mbgl { class Map; class Painter; class StyleLayer; class TransformState; struct box; class Source : public std::enable_shared_from_this, private util::noncopyable { public: Source(const util::ptr& info); void load(Map &map); bool update(Map &map); void updateMatrices(const mat4 &projMatrix, const TransformState &transform); void drawClippingMasks(Painter &painter); size_t getTileCount() const; void render(Painter &painter, util::ptr layer_desc); void render(Painter &painter, util::ptr layer_desc, const Tile::ID &id, const mat4 &matrix); void finishRender(Painter &painter); std::forward_list getIDs() const; std::forward_list getLoadedTiles() const; void updateClipIDs(const std::map &mapping); private: bool findLoadedChildren(const Tile::ID& id, int32_t maxCoveringZoom, std::forward_list& retain); bool findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::forward_list& retain); int32_t coveringZoomLevel(const TransformState&) const; std::forward_list coveringTiles(const TransformState&) const; bool updateTiles(Map &map); TileData::State addTile(Map &map, const Tile::ID& id); TileData::State hasTile(const Tile::ID& id); double getZoom(const TransformState &state) const; util::ptr info; bool loaded = false; // Stores the time when this source was most recently updated. timestamp updated = 0; std::map> tiles; std::map> tile_data; }; } #endif