#ifndef ENC_ATLASDATA_H #define ENC_ATLASDATA_H #include #include #include "common/rtree.h" #include "mapdata.h" namespace ENC { typedef QCache MapCache; class AtlasData { public: AtlasData(MapCache &cache, QMutex &cacheLock) : _cache(cache), _cacheLock(cacheLock) {} ~AtlasData(); void addMap(const RectC &bounds, const QString &path); void polys(const RectC &rect, QList *polygons, QList *lines); void points(const RectC &rect, QList *points); private: struct MapEntry { MapEntry(const QString &path) : path(path) {} QString path; QMutex lock; }; typedef RTree MapTree; struct PolyCTX { PolyCTX(const RectC &rect, QList *polygons, QList *lines, MapCache &cache, QMutex &cacheLock) : rect(rect), polygons(polygons), lines(lines), cache(cache), cacheLock(cacheLock) {} const RectC ▭ QList *polygons; QList *lines; MapCache &cache; QMutex &cacheLock; }; struct PointCTX { PointCTX(const RectC &rect, QList *points, MapCache &cache, QMutex &cacheLock) : rect(rect), points(points), cache(cache), cacheLock(cacheLock) {} const RectC ▭ QList *points; MapCache &cache; QMutex &cacheLock; }; static bool polyCb(MapEntry *map, void *context); static bool pointCb(MapEntry *map, void *context); MapTree _tree; MapCache &_cache; QMutex &_cacheLock; }; } #endif // ENC_ATLASDATA_H