@@ -65,8 +65,8 @@ private:
|
||||
bool findLoadedChildren(const Tile::ID& id, int32_t maxCoveringZoom, std::forward_list<Tile::ID>& retain);
|
||||
bool findLoadedParent(const Tile::ID& id, int32_t minCoveringZoom, std::forward_list<Tile::ID>& retain);
|
||||
bool updateTiles();
|
||||
std::shared_ptr<TileData> addTile(const Tile::ID& id);
|
||||
std::shared_ptr<TileData> hasTile(const Tile::ID& id);
|
||||
const Tile *addTile(const Tile::ID& id);
|
||||
const Tile *hasTile(const Tile::ID& id);
|
||||
|
||||
|
||||
void update();
|
||||
@@ -82,8 +82,8 @@ private:
|
||||
|
||||
float pixel_ratio;
|
||||
|
||||
std::forward_list<std::shared_ptr<TileData>> tiles;
|
||||
std::forward_list<std::shared_ptr<TileData>> historic_tiles;
|
||||
std::forward_list<Tile> tiles;
|
||||
std::forward_list<std::weak_ptr<TileData>> tile_data;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -2,19 +2,34 @@
|
||||
#define LLMR_MAP_TILE
|
||||
|
||||
#include <llmr/util/vec.hpp>
|
||||
#include <llmr/util/mat4.hpp>
|
||||
#include <llmr/util/noncopyable.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
#include <forward_list>
|
||||
|
||||
namespace llmr {
|
||||
|
||||
class Tile {
|
||||
class TileData;
|
||||
|
||||
class Tile : private util::noncopyable {
|
||||
public:
|
||||
typedef vec3<int32_t> ID;
|
||||
|
||||
public:
|
||||
Tile(const ID& id);
|
||||
|
||||
static ID parent(const ID& id, int32_t z);
|
||||
static ID normalize(const ID& id);
|
||||
static std::forward_list<ID> children(const ID& id, int32_t z);
|
||||
|
||||
|
||||
public:
|
||||
const Tile::ID id;
|
||||
uint8_t clip_id;
|
||||
mat4 matrix;
|
||||
std::shared_ptr<TileData> data;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ public:
|
||||
|
||||
public:
|
||||
const Tile::ID id;
|
||||
uint8_t clip_id;
|
||||
std::atomic<state> state;
|
||||
|
||||
// Holds the actual geometries in this tile.
|
||||
@@ -89,8 +88,6 @@ public:
|
||||
// Holds the buckets of this tile.
|
||||
// They contain the location offsets in the buffers stored above
|
||||
std::map<std::string, std::shared_ptr<Bucket>> buckets;
|
||||
|
||||
mat4 matrix;
|
||||
private:
|
||||
// Source data
|
||||
std::string data;
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
void setup();
|
||||
void clear();
|
||||
void changeMatrix();
|
||||
void render(const std::shared_ptr<TileData>& tile);
|
||||
void render(const Tile& tile);
|
||||
void renderMatte();
|
||||
void renderBackground();
|
||||
void renderFill(FillBucket& bucket, const std::string& layer_name, const Tile::ID& id);
|
||||
|
||||
Reference in New Issue
Block a user