diff --git a/android/tangram/jni/jniExports.cpp b/android/tangram/jni/jniExports.cpp index e5bd290c0f..0f9b9842c1 100644 --- a/android/tangram/jni/jniExports.cpp +++ b/android/tangram/jni/jniExports.cpp @@ -220,29 +220,29 @@ extern "C" { } } - JNIEXPORT jlong JNICALL Java_com_mapzen_tangram_MapController_nativeAddDataSource(JNIEnv* jniEnv, jobject obj, jlong mapPtr, jstring name) { + JNIEXPORT jlong JNICALL Java_com_mapzen_tangram_MapController_nativeAddTileSource(JNIEnv* jniEnv, jobject obj, jlong mapPtr, jstring name) { assert(mapPtr > 0); auto map = reinterpret_cast(mapPtr); auto sourceName = stringFromJString(jniEnv, name); - auto source = std::shared_ptr(new Tangram::ClientGeoJsonSource(sourceName, "")); - map->addDataSource(source); + auto source = std::shared_ptr(new Tangram::ClientGeoJsonSource(sourceName, "")); + map->addTileSource(source); return reinterpret_cast(source.get()); } - JNIEXPORT void JNICALL Java_com_mapzen_tangram_MapController_nativeRemoveDataSource(JNIEnv* jniEnv, jobject obj, jlong mapPtr, jlong sourcePtr) { + JNIEXPORT void JNICALL Java_com_mapzen_tangram_MapController_nativeRemoveTileSource(JNIEnv* jniEnv, jobject obj, jlong mapPtr, jlong sourcePtr) { assert(mapPtr > 0); auto map = reinterpret_cast(mapPtr); assert(sourcePtr > 0); - auto source = reinterpret_cast(sourcePtr); - map->removeDataSource(*source); + auto source = reinterpret_cast(sourcePtr); + map->removeTileSource(*source); } - JNIEXPORT void JNICALL Java_com_mapzen_tangram_MapController_nativeClearDataSource(JNIEnv* jniEnv, jobject obj, jlong mapPtr, jlong sourcePtr) { + JNIEXPORT void JNICALL Java_com_mapzen_tangram_MapController_nativeClearTileSource(JNIEnv* jniEnv, jobject obj, jlong mapPtr, jlong sourcePtr) { assert(mapPtr > 0); auto map = reinterpret_cast(mapPtr); assert(sourcePtr > 0); - auto source = reinterpret_cast(sourcePtr); - map->clearDataSource(*source, true, true); + auto source = reinterpret_cast(sourcePtr); + map->clearTileSource(*source, true, true); } JNIEXPORT void JNICALL Java_com_mapzen_tangram_MapController_nativeAddFeature(JNIEnv* jniEnv, jobject obj, jlong mapPtr, jlong sourcePtr, diff --git a/android/tangram/src/com/mapzen/tangram/MapController.java b/android/tangram/src/com/mapzen/tangram/MapController.java index 934d9613ac..578c44e7df 100644 --- a/android/tangram/src/com/mapzen/tangram/MapController.java +++ b/android/tangram/src/com/mapzen/tangram/MapController.java @@ -190,14 +190,14 @@ void dispose() { public void run() { // Dispose each data sources by first removing it from the HashMap values and then // calling remove(), so that we don't improperly modify the HashMap while iterating. - for (Iterator it = clientDataSources.values().iterator(); it.hasNext();) { + for (Iterator it = clientTileSources.values().iterator(); it.hasNext();) { MapData mapData = it.next(); it.remove(); mapData.remove(); } nativeDispose(mapPointer); mapPointer = 0; - clientDataSources.clear(); + clientTileSources.clear(); } }); } @@ -448,17 +448,17 @@ public PointF lngLatToScreenPosition(LngLat lngLat) { * object will be returned. */ public MapData addDataLayer(String name) { - MapData mapData = clientDataSources.get(name); + MapData mapData = clientTileSources.get(name); if (mapData != null) { return mapData; } checkPointer(mapPointer); - long pointer = nativeAddDataSource(mapPointer, name); + long pointer = nativeAddTileSource(mapPointer, name); if (pointer <= 0) { throw new RuntimeException("Unable to create new data source"); } mapData = new MapData(name, pointer, this); - clientDataSources.put(name, mapData); + clientTileSources.put(name, mapData); return mapData; } @@ -467,10 +467,10 @@ public MapData addDataLayer(String name) { * @param mapData The {@code MapData} to remove */ void removeDataLayer(MapData mapData) { - clientDataSources.remove(mapData.name); + clientTileSources.remove(mapData.name); checkPointer(mapPointer); checkPointer(mapData.pointer); - nativeRemoveDataSource(mapPointer, mapData.pointer); + nativeRemoveTileSource(mapPointer, mapData.pointer); } /** @@ -707,16 +707,16 @@ public void useCachedGlState(boolean use) { // Package private methods // ======================= - void removeDataSource(long sourcePtr) { + void removeTileSource(long sourcePtr) { checkPointer(mapPointer); checkPointer(sourcePtr); - nativeRemoveDataSource(mapPointer, sourcePtr); + nativeRemoveTileSource(mapPointer, sourcePtr); } - void clearDataSource(long sourcePtr) { + void clearTileSource(long sourcePtr) { checkPointer(mapPointer); checkPointer(sourcePtr); - nativeClearDataSource(mapPointer, sourcePtr); + nativeClearTileSource(mapPointer, sourcePtr); } void addFeature(long sourcePtr, double[] coordinates, int[] rings, String[] properties) { @@ -784,9 +784,9 @@ void checkPointer(long ptr) { private native void nativeOnUrlSuccess(byte[] rawDataBytes, long callbackPtr); private native void nativeOnUrlFailure(long callbackPtr); - synchronized native long nativeAddDataSource(long mapPtr, String name); - synchronized native void nativeRemoveDataSource(long mapPtr, long sourcePtr); - synchronized native void nativeClearDataSource(long mapPtr, long sourcePtr); + synchronized native long nativeAddTileSource(long mapPtr, String name); + synchronized native void nativeRemoveTileSource(long mapPtr, long sourcePtr); + synchronized native void nativeClearTileSource(long mapPtr, long sourcePtr); synchronized native void nativeAddFeature(long mapPtr, long sourcePtr, double[] coordinates, int[] rings, String[] properties); synchronized native void nativeAddGeoJson(long mapPtr, long sourcePtr, String geoJson); @@ -808,7 +808,7 @@ void checkPointer(long ptr) { private ViewCompleteListener viewCompleteListener; private FrameCaptureCallback frameCaptureCallback; private boolean frameCaptureAwaitCompleteView; - private Map clientDataSources = new HashMap<>(); + private Map clientTileSources = new HashMap<>(); // GLSurfaceView.Renderer methods // ============================== diff --git a/android/tangram/src/com/mapzen/tangram/MapData.java b/android/tangram/src/com/mapzen/tangram/MapData.java index 23b1ed6fc6..806dfd7dd4 100644 --- a/android/tangram/src/com/mapzen/tangram/MapData.java +++ b/android/tangram/src/com/mapzen/tangram/MapData.java @@ -112,7 +112,7 @@ public MapData addGeoJson(String data) { * @return This object, for chaining. */ public MapData clear() { - map.clearDataSource(pointer); + map.clearTileSource(pointer); return this; } diff --git a/bench/src/tileLoading.cpp b/bench/src/tileLoading.cpp index f0d9b5fdfd..464506bfc4 100644 --- a/bench/src/tileLoading.cpp +++ b/bench/src/tileLoading.cpp @@ -2,7 +2,7 @@ #include "gl.h" #include "platform.h" #include "log.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "scene/sceneLoader.h" #include "scene/scene.h" #include "style/style.h" @@ -30,7 +30,7 @@ struct TestContext { std::shared_ptr scene; StyleContext styleContext; - std::shared_ptr source; + std::shared_ptr source; std::vector rawTileData; @@ -56,7 +56,7 @@ struct TestContext { styleContext.initFunctions(*scene); styleContext.setKeywordZoom(0); - source = *scene->dataSources().begin(); + source = *scene->tileSources().begin(); tileBuilder = std::make_unique(scene); } @@ -78,7 +78,7 @@ struct TestContext { void parseTile() { Tile tile({0,0,10,10,0}, s_projection); - source = *scene->dataSources().begin(); + source = *scene->tileSources().begin(); auto task = source->createTask(tile.getID()); auto& t = dynamic_cast(*task); t.rawTileData = std::make_shared>(rawTileData); diff --git a/core/src/data/clientGeoJsonSource.cpp b/core/src/data/clientGeoJsonSource.cpp index 6c016ddf6a..1f6e2b9a17 100644 --- a/core/src/data/clientGeoJsonSource.cpp +++ b/core/src/data/clientGeoJsonSource.cpp @@ -34,7 +34,7 @@ Point transformPoint(geojsonvt::TilePoint pt) { // TODO: pass scene's resourcePath to constructor to be used with `stringFromFile` ClientGeoJsonSource::ClientGeoJsonSource(const std::string& _name, const std::string& _url, int32_t _minDisplayZoom, int32_t _maxDisplayZoom, int32_t _maxZoom) - : DataSource(_name, nullptr, _minDisplayZoom, _maxDisplayZoom, _maxZoom) { + : TileSource(_name, nullptr, _minDisplayZoom, _maxDisplayZoom, _maxZoom) { // TODO: handle network url for client datasource data // TODO: generic uri handling @@ -87,7 +87,7 @@ void ClientGeoJsonSource::loadTileData(std::shared_ptr _task, TileTask } // Load subsources - DataSource::loadTileData(_task, _cb); + TileSource::loadTileData(_task, _cb); } void ClientGeoJsonSource::clearData() { diff --git a/core/src/data/clientGeoJsonSource.h b/core/src/data/clientGeoJsonSource.h index 9bc3d93f80..e3d80afc6a 100644 --- a/core/src/data/clientGeoJsonSource.h +++ b/core/src/data/clientGeoJsonSource.h @@ -1,6 +1,6 @@ #pragma once -#include "dataSource.h" +#include "tileSource.h" #include "util/types.h" #include @@ -19,7 +19,7 @@ using GeoJSONVT = mapbox::util::geojsonvt::GeoJSONVT; struct Properties; -class ClientGeoJsonSource : public DataSource { +class ClientGeoJsonSource : public TileSource { public: diff --git a/core/src/data/geoJsonSource.h b/core/src/data/geoJsonSource.h index 8f13f4bd98..be413af838 100644 --- a/core/src/data/geoJsonSource.h +++ b/core/src/data/geoJsonSource.h @@ -1,13 +1,13 @@ #pragma once -#include "dataSource.h" +#include "tileSource.h" namespace Tangram { -class GeoJsonSource: public DataSource { +class GeoJsonSource: public TileSource { public: - using DataSource::DataSource; + using TileSource::TileSource; protected: diff --git a/core/src/data/memoryCacheDataSource.h b/core/src/data/memoryCacheDataSource.h index c78578dfaf..a1df8bfdd2 100644 --- a/core/src/data/memoryCacheDataSource.h +++ b/core/src/data/memoryCacheDataSource.h @@ -1,10 +1,10 @@ #pragma once -#include "data/dataSource.h" +#include "data/tileSource.h" namespace Tangram { -class MemoryCacheDataSource : public RawDataSource { +class MemoryCacheDataSource : public TileSource::DataSource { public: MemoryCacheDataSource(); diff --git a/core/src/data/mvtSource.h b/core/src/data/mvtSource.h index 3e2ea1c3e5..659594c8e5 100644 --- a/core/src/data/mvtSource.h +++ b/core/src/data/mvtSource.h @@ -1,13 +1,13 @@ #pragma once -#include "dataSource.h" +#include "tileSource.h" namespace Tangram { -class MVTSource : public DataSource { +class MVTSource : public TileSource { public: - using DataSource::DataSource; + using TileSource::TileSource; protected: diff --git a/core/src/data/networkDataSource.h b/core/src/data/networkDataSource.h index 0ab37fa97d..fbb280b4e3 100644 --- a/core/src/data/networkDataSource.h +++ b/core/src/data/networkDataSource.h @@ -1,10 +1,10 @@ #pragma once -#include "data/dataSource.h" +#include "data/tileSource.h" namespace Tangram { -class NetworkDataSource : public RawDataSource { +class NetworkDataSource : public TileSource::DataSource { public: NetworkDataSource(const std::string& _urlTemplate) : m_urlTemplate(_urlTemplate) {} diff --git a/core/src/data/rasterSource.cpp b/core/src/data/rasterSource.cpp index 0dd93752a5..41c00705fb 100644 --- a/core/src/data/rasterSource.cpp +++ b/core/src/data/rasterSource.cpp @@ -12,7 +12,7 @@ namespace Tangram { class RasterTileTask : public DownloadTileTask { public: - RasterTileTask(TileID& _tileId, std::shared_ptr _source, int _subTask) + RasterTileTask(TileID& _tileId, std::shared_ptr _source, int _subTask) : DownloadTileTask(_tileId, _source, _subTask) {} std::shared_ptr m_texture; @@ -69,10 +69,10 @@ class RasterTileTask : public DownloadTileTask { }; -RasterSource::RasterSource(const std::string& _name, std::unique_ptr _sources, +RasterSource::RasterSource(const std::string& _name, std::unique_ptr _sources, int32_t _minDisplayZoom, int32_t _maxDisplayZoom, int32_t _maxZoom, TextureOptions _options, bool _genMipmap) - : DataSource(_name, std::move(_sources), _minDisplayZoom, _maxDisplayZoom, _maxZoom), + : TileSource(_name, std::move(_sources), _minDisplayZoom, _maxDisplayZoom, _maxZoom), m_texOptions(_options), m_genMipmap(_genMipmap) { @@ -104,7 +104,7 @@ void RasterSource::loadTileData(std::shared_ptr _task, TileTaskCb _cb) _cb.func(_task); }}; - DataSource::loadTileData(_task, cb); + TileSource::loadTileData(_task, cb); } std::shared_ptr RasterSource::parse(const TileTask& _task, const MapProjection& _projection) const { diff --git a/core/src/data/rasterSource.h b/core/src/data/rasterSource.h index 18b5331d15..073b297026 100644 --- a/core/src/data/rasterSource.h +++ b/core/src/data/rasterSource.h @@ -3,7 +3,7 @@ #include #include "tile/tileHash.h" -#include "dataSource.h" +#include "tileSource.h" #include "gl/texture.h" #include @@ -14,7 +14,7 @@ namespace Tangram { class RasterTileTask; -class RasterSource : public DataSource { +class RasterSource : public TileSource { TextureOptions m_texOptions; bool m_genMipmap; @@ -29,7 +29,7 @@ class RasterSource : public DataSource { public: - RasterSource(const std::string& _name, std::unique_ptr _sources, + RasterSource(const std::string& _name, std::unique_ptr _sources, int32_t _minDisplayZoom, int32_t _maxDisplayZoom, int32_t _maxZoom, TextureOptions _options, bool genMipmap = false); diff --git a/core/src/data/dataSource.cpp b/core/src/data/tileSource.cpp similarity index 81% rename from core/src/data/dataSource.cpp rename to core/src/data/tileSource.cpp index 069ca09ec7..07ee5d263c 100644 --- a/core/src/data/dataSource.cpp +++ b/core/src/data/tileSource.cpp @@ -1,4 +1,4 @@ -#include "dataSource.h" +#include "tileSource.h" #include "platform.h" #include "tileData.h" @@ -12,7 +12,7 @@ namespace Tangram { -DataSource::DataSource(const std::string& _name, std::unique_ptr _sources, +TileSource::TileSource(const std::string& _name, std::unique_ptr _sources, int32_t _minDisplayZoom, int32_t _maxDisplayZoom, int32_t _maxZoom) : m_name(_name), m_minDisplayZoom(_minDisplayZoom), m_maxDisplayZoom(_maxDisplayZoom), m_maxZoom(_maxZoom), @@ -23,11 +23,11 @@ DataSource::DataSource(const std::string& _name, std::unique_ptr m_id = s_serial++; } -DataSource::~DataSource() { +TileSource::~TileSource() { clearData(); } -std::shared_ptr DataSource::createTask(TileID _tileId, int _subTask) { +std::shared_ptr TileSource::createTask(TileID _tileId, int _subTask) { auto task = std::make_shared(_tileId, shared_from_this(), _subTask); createSubTasks(task); @@ -35,7 +35,7 @@ std::shared_ptr DataSource::createTask(TileID _tileId, int _subTask) { return task; } -void DataSource::createSubTasks(std::shared_ptr _task) { +void TileSource::createSubTasks(std::shared_ptr _task) { size_t index = 0; for (auto& subSource : m_rasterSources) { @@ -50,16 +50,16 @@ void DataSource::createSubTasks(std::shared_ptr _task) { } } -void DataSource::clearData() { +void TileSource::clearData() { if (m_sources) { m_sources->clear(); } m_generation++; } -bool DataSource::equals(const DataSource& other) const { +bool TileSource::equals(const TileSource& other) const { if (m_name != other.m_name) { return false; } - // TODO compare RawDataSources instead + // TODO compare DataSources instead //if (m_urlTemplate != other.m_urlTemplate) { return false; } if (m_minDisplayZoom != other.m_minDisplayZoom) { return false; } if (m_maxDisplayZoom != other.m_maxDisplayZoom) { return false; } @@ -72,7 +72,7 @@ bool DataSource::equals(const DataSource& other) const { return true; } -void DataSource::loadTileData(std::shared_ptr _task, TileTaskCb _cb) { +void TileSource::loadTileData(std::shared_ptr _task, TileTaskCb _cb) { if (m_sources) { if (_task->needsLoading()) { @@ -87,7 +87,7 @@ void DataSource::loadTileData(std::shared_ptr _task, TileTaskCb _cb) { } } -void DataSource::cancelLoadingTile(const TileID& _tileID) { +void TileSource::cancelLoadingTile(const TileID& _tileID) { if (m_sources) { return m_sources->cancelLoadingTile(_tileID); } @@ -97,20 +97,20 @@ void DataSource::cancelLoadingTile(const TileID& _tileID) { } } -void DataSource::clearRasters() { +void TileSource::clearRasters() { for (auto& raster : m_rasterSources) { raster->clearRasters(); } } -void DataSource::clearRaster(const TileID& id) { +void TileSource::clearRaster(const TileID& id) { for (auto& raster : m_rasterSources) { TileID rasterID = id.withMaxSourceZoom(raster->maxZoom()); raster->clearRaster(rasterID); } } -void DataSource::addRasterSource(std::shared_ptr _rasterSource) { +void TileSource::addRasterSource(std::shared_ptr _rasterSource) { /* * We limit the parent source by any attached raster source's min/max. */ diff --git a/core/src/data/dataSource.h b/core/src/data/tileSource.h similarity index 72% rename from core/src/data/dataSource.h rename to core/src/data/tileSource.h index 10e8038e9c..4e1973e1b0 100644 --- a/core/src/data/dataSource.h +++ b/core/src/data/tileSource.h @@ -19,37 +19,37 @@ class TileManager; struct RawCache; class Texture; -struct RawDataSource { - virtual bool loadTileData(std::shared_ptr _task, TileTaskCb _cb) = 0; +class TileSource : public std::enable_shared_from_this { - /* Stops any running I/O tasks pertaining to @_tile */ - virtual void cancelLoadingTile(const TileID& _tile) { - if (next) { next->cancelLoadingTile(_tile); } - } +public: - virtual void clear() { if (next) next->clear(); } + struct DataSource { + virtual bool loadTileData(std::shared_ptr _task, TileTaskCb _cb) = 0; - void setNext(std::unique_ptr _next) { - next = std::move(_next); - next->level = level + 1; - } - std::unique_ptr next; - int level = 0; -}; + /* Stops any running I/O tasks pertaining to @_tile */ + virtual void cancelLoadingTile(const TileID& _tile) { + if (next) { next->cancelLoadingTile(_tile); } + } -class DataSource : public std::enable_shared_from_this { + virtual void clear() { if (next) next->clear(); } -public: + void setNext(std::unique_ptr _next) { + next = std::move(_next); + next->level = level + 1; + } + std::unique_ptr next; + int level = 0; + }; /* Tile data sources must have a name and a URL template that defines where to find * a tile based on its coordinates. A URL template includes exactly one occurrance * each of '{x}', '{y}', and '{z}' which will be replaced by the x index, y index, * and zoom level of tiles to produce their URL. */ - DataSource(const std::string& _name, std::unique_ptr _sources, + TileSource(const std::string& _name, std::unique_ptr _sources, int32_t _minDisplayZoom = -1, int32_t _maxDisplayZoom = -1, int32_t _maxZoom = 18); - virtual ~DataSource(); + virtual ~TileSource(); /* Fetches data for the map tile specified by @_tileID * @@ -65,7 +65,7 @@ class DataSource : public std::enable_shared_from_this { /* Parse a with data into a , returning an empty TileData on failure */ virtual std::shared_ptr parse(const TileTask& _task, const MapProjection& _projection) const = 0; - /* Clears all data associated with this DataSource */ + /* Clears all data associated with this TileSource */ virtual void clearData(); const std::string& name() const { return m_name; } @@ -73,14 +73,14 @@ class DataSource : public std::enable_shared_from_this { virtual void clearRasters(); virtual void clearRaster(const TileID& id); - bool equals(const DataSource& _other) const; + bool equals(const TileSource& _other) const; virtual std::shared_ptr createTask(TileID _tile, int _subTask = -1); - /* ID of this DataSource instance */ + /* ID of this TileSource instance */ int32_t id() const { return m_id; } - /* Generation ID of DataSource state (incremented for each update, e.g. on clearData()) */ + /* Generation ID of TileSource state (incremented for each update, e.g. on clearData()) */ int64_t generation() const { return m_generation; } int32_t minDisplayZoom() const { return m_minDisplayZoom; } @@ -92,7 +92,7 @@ class DataSource : public std::enable_shared_from_this { } /* assign/get raster datasources to this datasource */ - void addRasterSource(std::shared_ptr _dataSource); + void addRasterSource(std::shared_ptr _dataSource); auto& rasterSources() { return m_rasterSources; } const auto& rasterSources() const { return m_rasterSources; } @@ -121,16 +121,16 @@ class DataSource : public std::enable_shared_from_this { // Maximum zoom for which tiles will be requested int32_t m_maxZoom; - // Unique id for DataSource + // Unique id for TileSource int32_t m_id; - // Generation of dynamic DataSource state (incremented for each update) + // Generation of dynamic TileSource state (incremented for each update) int64_t m_generation = 1; /* vector of raster sources (as raster samplers) referenced by this datasource */ - std::vector> m_rasterSources; + std::vector> m_rasterSources; - std::unique_ptr m_sources; + std::unique_ptr m_sources; }; diff --git a/core/src/data/topoJsonSource.h b/core/src/data/topoJsonSource.h index 13d13930d0..cbebc0e314 100644 --- a/core/src/data/topoJsonSource.h +++ b/core/src/data/topoJsonSource.h @@ -1,13 +1,13 @@ #pragma once -#include "dataSource.h" +#include "tileSource.h" namespace Tangram { -class TopoJsonSource : public DataSource { +class TopoJsonSource : public TileSource { public: - using DataSource::DataSource; + using TileSource::TileSource; protected: diff --git a/core/src/scene/dataLayer.h b/core/src/scene/dataLayer.h index 935ce8a3f3..6913f13917 100644 --- a/core/src/scene/dataLayer.h +++ b/core/src/scene/dataLayer.h @@ -6,7 +6,7 @@ namespace Tangram { // DataLayer represents a top-level layer in the stylesheet, distinct from -// SceneLayer by its association with a collection within a DataSource +// SceneLayer by its association with a collection within a TileSource class DataLayer : public SceneLayer { std::string m_source; diff --git a/core/src/scene/importer.cpp b/core/src/scene/importer.cpp index 0bf261d4f1..8916d90a2c 100644 --- a/core/src/scene/importer.cpp +++ b/core/src/scene/importer.cpp @@ -93,7 +93,7 @@ void Importer::processScene(const std::string &scenePath, const std::string &sce auto sceneNode = YAML::Load(sceneString); normalizeSceneImports(sceneNode, scenePath); - normalizeSceneDataSources(sceneNode, scenePath); + normalizeSceneTileSources(sceneNode, scenePath); normalizeSceneTextures(sceneNode, scenePath); normalizeFonts(sceneNode, scenePath); @@ -139,7 +139,7 @@ void Importer::normalizeSceneImports(Node& root, const std::string& parentPath) } } -void Importer::normalizeSceneDataSources(Node &root, const std::string &parentPath) { +void Importer::normalizeSceneTileSources(Node &root, const std::string &parentPath) { if (Node sources = root["sources"]) { for (auto source : sources) { if (Node sourceUrl = source.second["url"]) { diff --git a/core/src/scene/importer.h b/core/src/scene/importer.h index fb90c42bfc..0a0bac8278 100644 --- a/core/src/scene/importer.h +++ b/core/src/scene/importer.h @@ -51,7 +51,7 @@ class Importer { void setNormalizedTexture(Node& texture, const std::vector& names, const std::string& parentPath); void normalizeSceneImports(Node& root, const std::string& parentPath); - void normalizeSceneDataSources(Node& root, const std::string& parentPath); + void normalizeSceneTileSources(Node& root, const std::string& parentPath); void normalizeFonts(Node& root, const std::string& parentPath); std::string normalizePath(const std::string& path, const std::string& parentPath); diff --git a/core/src/scene/scene.cpp b/core/src/scene/scene.cpp index 1235c1a612..ead2baebf7 100644 --- a/core/src/scene/scene.cpp +++ b/core/src/scene/scene.cpp @@ -1,6 +1,6 @@ #include "scene.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "gl/shaderProgram.h" #include "platform.h" #include "scene/dataLayer.h" @@ -129,10 +129,10 @@ std::shared_ptr Scene::getTexture(const std::string& textureName) const return texIt->second; } -std::shared_ptr Scene::getDataSource(const std::string& name) { - auto it = std::find_if(m_dataSources.begin(), m_dataSources.end(), +std::shared_ptr Scene::getTileSource(const std::string& name) { + auto it = std::find_if(m_tileSources.begin(), m_tileSources.end(), [&](auto& s){ return s->name() == name; }); - if (it != m_dataSources.end()) { + if (it != m_tileSources.end()) { return *it; } return nullptr; diff --git a/core/src/scene/scene.h b/core/src/scene/scene.h index f8a22329cb..4449e4343f 100644 --- a/core/src/scene/scene.h +++ b/core/src/scene/scene.h @@ -17,14 +17,14 @@ namespace Tangram { -class Style; -class Texture; -class DataSource; class DataLayer; class FontContext; class Light; class MapProjection; class SpriteAtlas; +class Style; +class Texture; +class TileSource; struct Stops; @@ -65,7 +65,7 @@ class Scene { auto& resourceRoot() { return m_resourceRoot; } auto& config() { return m_config; } - auto& dataSources() { return m_dataSources; }; + auto& tileSources() { return m_tileSources; }; auto& layers() { return m_layers; }; auto& styles() { return m_styles; }; auto& lights() { return m_lights; }; @@ -81,7 +81,7 @@ class Scene { const auto& path() const { return m_path; } const auto& resourceRoot() const { return m_resourceRoot; } const auto& config() const { return m_config; } - const auto& dataSources() const { return m_dataSources; }; + const auto& tileSources() const { return m_tileSources; }; const auto& layers() const { return m_layers; }; const auto& styles() const { return m_styles; }; const auto& lights() const { return m_lights; }; @@ -110,7 +110,7 @@ class Scene { void animated(bool animated) { m_animated = animated ? yes : no; } animate animated() const { return m_animated; } - std::shared_ptr getDataSource(const std::string& name); + std::shared_ptr getTileSource(const std::string& name); std::shared_ptr getTexture(const std::string& name) const; @@ -133,7 +133,7 @@ class Scene { std::unique_ptr m_mapProjection; std::vector m_layers; - std::vector> m_dataSources; + std::vector> m_tileSources; std::vector> m_styles; std::vector> m_lights; std::unordered_map> m_textures; diff --git a/core/src/scene/sceneLoader.cpp b/core/src/scene/sceneLoader.cpp index e6a91b8705..e62e2c584b 100644 --- a/core/src/scene/sceneLoader.cpp +++ b/core/src/scene/sceneLoader.cpp @@ -892,8 +892,8 @@ bool SceneLoader::loadStyle(const std::string& name, Node config, const std::sha } void SceneLoader::loadSource(const std::string& name, const Node& source, const Node& sources, const std::shared_ptr& _scene) { - if (_scene->getDataSource(name)) { - LOGW("Duplicate DataSource: %s", name.c_str()); + if (_scene->getTileSource(name)) { + LOGW("Duplicate TileSource: %s", name.c_str()); return; } @@ -944,7 +944,7 @@ void SceneLoader::loadSource(const std::string& name, const Node& source, const url.find("{y}") != std::string::npos && url.find("{z}") != std::string::npos; - std::shared_ptr sourcePtr; + std::shared_ptr sourcePtr; auto rawSources = std::make_unique(); rawSources->setCacheSize(CACHE_SIZE); @@ -982,7 +982,7 @@ void SceneLoader::loadSource(const std::string& name, const Node& source, const } if (sourcePtr) { - _scene->dataSources().push_back(sourcePtr); + _scene->tileSources().push_back(sourcePtr); } if (auto rasters = source["rasters"]) { @@ -991,7 +991,7 @@ void SceneLoader::loadSource(const std::string& name, const Node& source, const } -void SceneLoader::loadSourceRasters(std::shared_ptr &source, Node rasterNode, const Node& sources, +void SceneLoader::loadSourceRasters(std::shared_ptr &source, Node rasterNode, const Node& sources, const std::shared_ptr& scene) { if (rasterNode.IsSequence()) { for (const auto& raster : rasterNode) { @@ -1002,7 +1002,7 @@ void SceneLoader::loadSourceRasters(std::shared_ptr &source, Node ra LOGNode("Parsing sources: '%s'", sources[srcName], e.what()); return; } - source->addRasterSource(scene->getDataSource(srcName)); + source->addRasterSource(scene->getTileSource(srcName)); } } } @@ -1633,7 +1633,7 @@ void SceneLoader::loadLayer(const std::pair& layer, const std::share if (Node data_source = data["source"]) { if (data_source.IsScalar()) { source = data_source.Scalar(); - auto dataSource = scene->getDataSource(source); + auto dataSource = scene->getTileSource(source); if (dataSource) { dataSource->generateGeometry(true); } else { diff --git a/core/src/scene/sceneLoader.h b/core/src/scene/sceneLoader.h index d45809eba3..a694d68693 100644 --- a/core/src/scene/sceneLoader.h +++ b/core/src/scene/sceneLoader.h @@ -17,17 +17,17 @@ namespace Tangram { -class TileManager; +class Material; +class PointLight; class SceneLayer; -class View; class ShaderProgram; -class Material; class Style; -struct StyleParam; -struct MaterialTexture; -class PointLight; -class DataSource; +class TileManager; +class TileSource; +class View; struct Filter; +struct MaterialTexture; +struct StyleParam; struct TextureFiltering; struct TextureOptions; @@ -50,7 +50,7 @@ struct SceneLoader { static void loadBackground(Node background, const std::shared_ptr& scene); static void loadSource(const std::string& name, const Node& source, const Node& sources, const std::shared_ptr& scene); - static void loadSourceRasters(std::shared_ptr& source, Node rasterNode, const Node& sources, + static void loadSourceRasters(std::shared_ptr& source, Node rasterNode, const Node& sources, const std::shared_ptr& scene); static void loadTexture(const std::pair& texture, const std::shared_ptr& scene); static void loadLayer(const std::pair& layer, const std::shared_ptr& scene); diff --git a/core/src/style/style.cpp b/core/src/style/style.cpp index 7fc82f70bc..d6150e4e57 100644 --- a/core/src/style/style.cpp +++ b/core/src/style/style.cpp @@ -10,7 +10,7 @@ #include "scene/scene.h" #include "scene/spriteAtlas.h" #include "tile/tile.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "view/view.h" #include "marker/marker.h" #include "tangram.h" @@ -75,7 +75,7 @@ void Style::build(const Scene& _scene) { } } - setupRasters(_scene.dataSources()); + setupRasters(_scene.tileSources()); } void Style::setMaterial(const std::shared_ptr& _material) { @@ -145,14 +145,14 @@ void Style::setupShaderUniforms(RenderState& rs, Scene& _scene) { } } -void Style::setupRasters(const std::vector>& _dataSources) { +void Style::setupRasters(const std::vector>& _sources) { if (!hasRasters()) { return; } int numRasterSource = 0; - for (const auto& dataSource : _dataSources) { - if (dataSource->isRaster()) { + for (const auto& source : _sources) { + if (source->isRaster()) { numRasterSource++; } } diff --git a/core/src/style/style.h b/core/src/style/style.h index c98ac6aa4b..a43fbfb64d 100644 --- a/core/src/style/style.h +++ b/core/src/style/style.h @@ -11,23 +11,23 @@ namespace Tangram { -struct DrawRule; class Label; class LabelCollider; class Light; -struct LightUniforms; -class Tile; class MapProjection; -class Material; -struct MaterialUniforms; class Marker; -class VertexLayout; -class View; +class Material; +class RenderState; class Scene; class ShaderProgram; class Style; -class DataSource; -class RenderState; +class Tile; +class TileSource; +class VertexLayout; +class View; +struct DrawRule; +struct LightUniforms; +struct MaterialUniforms; enum class LightingType : char { none, @@ -274,7 +274,7 @@ using StyleUniform = std::pair; virtual bool hasRasters() const { return m_rasterType != RasterType::none; } - void setupRasters(const std::vector>& _dataSources); + void setupRasters(const std::vector>& _sources); std::vector& styleUniforms() { return m_styleUniforms; } diff --git a/core/src/tangram.cpp b/core/src/tangram.cpp index 5ab77d1837..a505b623d2 100644 --- a/core/src/tangram.cpp +++ b/core/src/tangram.cpp @@ -147,7 +147,7 @@ void Map::Impl::setScene(std::shared_ptr& _scene) { } inputHandler.setView(view); - tileManager.setDataSources(_scene->dataSources()); + tileManager.setTileSources(_scene->tileSources()); tileWorker.setScene(_scene); markerManager.setScene(_scene); setPixelScale(view.pixelScale()); @@ -597,17 +597,17 @@ int Map::getCameraType() { } -void Map::addDataSource(std::shared_ptr _source) { +void Map::addTileSource(std::shared_ptr _source) { std::lock_guard lock(impl->tilesMutex); - impl->tileManager.addClientDataSource(_source); + impl->tileManager.addClientTileSource(_source); } -bool Map::removeDataSource(DataSource& source) { +bool Map::removeTileSource(TileSource& source) { std::lock_guard lock(impl->tilesMutex); - return impl->tileManager.removeClientDataSource(source); + return impl->tileManager.removeClientTileSource(source); } -void Map::clearDataSource(DataSource& _source, bool _data, bool _tiles) { +void Map::clearTileSource(TileSource& _source, bool _data, bool _tiles) { std::lock_guard lock(impl->tilesMutex); if (_tiles) { impl->tileManager.clearTileSet(_source.id()); } diff --git a/core/src/tangram.h b/core/src/tangram.h index 462ce1a38f..8d7cd30ecb 100644 --- a/core/src/tangram.h +++ b/core/src/tangram.h @@ -9,7 +9,7 @@ namespace Tangram { -class DataSource; +class TileSource; struct TouchItem { std::shared_ptr properties; @@ -140,15 +140,15 @@ class Map { // point is not visible on the screen, otherwise returns true bool lngLatToScreenPosition(double _lng, double _lat, double* _x, double* _y); - // Add a data source for adding drawable map data, which will be styled + // Add a tile source for adding drawable map data, which will be styled // according to the scene file using the provided data source name; - void addDataSource(std::shared_ptr _source); + void addTileSource(std::shared_ptr _source); - // Remove a data source from the map; returns true if the source was found + // Remove a tile source from the map; returns true if the source was found // and removed, otherwise returns false. - bool removeDataSource(DataSource& _source); + bool removeTileSource(TileSource& _source); - void clearDataSource(DataSource& _source, bool _data, bool _tiles); + void clearTileSource(TileSource& _source, bool _data, bool _tiles); // Add a marker object to the map and return an ID for it; an ID of 0 indicates an invalid marker; // the marker will not be drawn until both styling and geometry are set using the functions below. diff --git a/core/src/tile/tile.cpp b/core/src/tile/tile.cpp index 524a8b37da..bb0a790272 100644 --- a/core/src/tile/tile.cpp +++ b/core/src/tile/tile.cpp @@ -1,6 +1,6 @@ #include "tile.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "style/style.h" #include "view/view.h" #include "tile/tileID.h" @@ -10,7 +10,7 @@ namespace Tangram { -Tile::Tile(TileID _id, const MapProjection& _projection, const DataSource* _source) : +Tile::Tile(TileID _id, const MapProjection& _projection, const TileSource* _source) : m_id(_id), m_projection(&_projection), m_sourceId(_source ? _source->id() : 0), diff --git a/core/src/tile/tile.h b/core/src/tile/tile.h index 0e39f485ce..385a354204 100644 --- a/core/src/tile/tile.h +++ b/core/src/tile/tile.h @@ -12,7 +12,7 @@ namespace Tangram { -class DataSource; +class TileSource; class MapProjection; class Style; class View; @@ -38,7 +38,7 @@ class Tile { public: - Tile(TileID _id, const MapProjection& _projection, const DataSource* _source = nullptr); + Tile(TileID _id, const MapProjection& _projection, const TileSource* _source = nullptr); virtual ~Tile(); @@ -100,10 +100,10 @@ class Tile { float m_inverseScale = 1; - /* ID of the DataSource */ + /* ID of the TileSource */ const int32_t m_sourceId; - /* State of the DataSource for which this tile was created */ + /* State of the TileSource for which this tile was created */ const int64_t m_sourceGeneration; bool m_proxyState = false; diff --git a/core/src/tile/tileBuilder.cpp b/core/src/tile/tileBuilder.cpp index aac45b7428..6d5639fce6 100644 --- a/core/src/tile/tileBuilder.cpp +++ b/core/src/tile/tileBuilder.cpp @@ -1,6 +1,6 @@ #include "tile/tileBuilder.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "gl/mesh.h" #include "scene/dataLayer.h" #include "scene/scene.h" @@ -30,7 +30,7 @@ StyleBuilder* TileBuilder::getStyleBuilder(const std::string& _name) { return it->second.get(); } -std::shared_ptr TileBuilder::build(TileID _tileID, const TileData& _tileData, const DataSource& _source) { +std::shared_ptr TileBuilder::build(TileID _tileID, const TileData& _tileData, const TileSource& _source) { auto tile = std::make_shared(_tileID, *m_scene->mapProjection(), &_source); diff --git a/core/src/tile/tileBuilder.h b/core/src/tile/tileBuilder.h index e51530cb3d..969d617a48 100644 --- a/core/src/tile/tileBuilder.h +++ b/core/src/tile/tileBuilder.h @@ -1,6 +1,6 @@ #pragma once -#include "data/dataSource.h" +#include "data/tileSource.h" #include "scene/styleContext.h" #include "scene/drawRule.h" #include "labels/labelCollider.h" @@ -8,7 +8,7 @@ namespace Tangram { class DataLayer; -class DataSource; +class TileSource; class Tile; struct TileData; class StyleBuilder; @@ -23,7 +23,7 @@ class TileBuilder { StyleBuilder* getStyleBuilder(const std::string& _name); - std::shared_ptr build(TileID _tileID, const TileData& _data, const DataSource& _source); + std::shared_ptr build(TileID _tileID, const TileData& _data, const TileSource& _source); const Scene& scene() const { return *m_scene; } diff --git a/core/src/tile/tileManager.cpp b/core/src/tile/tileManager.cpp index a67f5e9156..a7e2e6d55d 100644 --- a/core/src/tile/tileManager.cpp +++ b/core/src/tile/tileManager.cpp @@ -1,6 +1,6 @@ #include "tileManager.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "platform.h" #include "tile/tile.h" #include "tileCache.h" @@ -38,7 +38,7 @@ TileManager::~TileManager() { m_tileSets.clear(); } -void TileManager::setDataSources(const std::vector>& _sources) { +void TileManager::setTileSources(const std::vector>& _sources) { m_tileCache->clear(); @@ -46,7 +46,7 @@ void TileManager::setDataSources(const std::vector>& auto it = std::remove_if( m_tileSets.begin(), m_tileSets.end(), [&](auto& tileSet) { - if (!tileSet.clientDataSource) { + if (!tileSet.clientTileSource) { auto sIt = std::find_if(_sources.begin(), _sources.end(), [&](auto& source){ return source->equals(*tileSet.source); }); @@ -78,17 +78,17 @@ void TileManager::setDataSources(const std::vector>& } } -void TileManager::addClientDataSource(std::shared_ptr _dataSource) { - m_tileSets.push_back({ _dataSource, true }); +void TileManager::addClientTileSource(std::shared_ptr _tileSource) { + m_tileSets.push_back({ _tileSource, true }); } -bool TileManager::removeClientDataSource(DataSource& dataSource) { +bool TileManager::removeClientTileSource(TileSource& _tileSource) { bool removed = false; for (auto it = m_tileSets.begin(); it != m_tileSets.end();) { - if (it->source.get() == &dataSource) { - // Remove the textures for this data source + if (it->source.get() == &_tileSource) { + // Remove the textures for this tile source it->source->clearRasters(); - // Remove the tile set associated with this data source + // Remove the tile set associated with this tile source it = m_tileSets.erase(it); removed = true; } else { @@ -464,7 +464,7 @@ void TileManager::removeTile(TileSet& _tileSet, std::map::ite //remove tile from set _tileIt = _tileSet.tiles.erase(_tileIt); - // Remove rasters from this DataSource + // Remove rasters from this TileSource _tileSet.source->clearRaster(id); } diff --git a/core/src/tile/tileManager.h b/core/src/tile/tileManager.h index 2b82d2a079..0abb8295e4 100644 --- a/core/src/tile/tileManager.h +++ b/core/src/tile/tileManager.h @@ -13,11 +13,11 @@ #include #include #include -#include +#include namespace Tangram { -class DataSource; +class TileSource; class TileCache; struct ViewState; @@ -37,8 +37,8 @@ class TileManager { virtual ~TileManager(); - /* Sets the tile DataSources */ - void setDataSources(const std::vector>& _sources); + /* Sets the tile TileSources */ + void setTileSources(const std::vector>& _sources); /* Updates visible tile set and load missing tiles */ void updateTileSets(const ViewState& _view, const std::set& _visibleTiles); @@ -54,9 +54,9 @@ class TileManager { bool hasLoadingTiles() { return m_tilesInProgress > 0; } - void addClientDataSource(std::shared_ptr _dataSource); + void addClientTileSource(std::shared_ptr _source); - bool removeClientDataSource(DataSource& dataSource); + bool removeClientTileSource(TileSource& _source); std::unique_ptr& getTileCache() { return m_tileCache; } @@ -187,13 +187,13 @@ class TileManager { }; struct TileSet { - TileSet(std::shared_ptr _source, bool _clientDataSource) - : source(_source), clientDataSource(_clientDataSource) {} + TileSet(std::shared_ptr _source, bool _clientSource) + : source(_source), clientTileSource(_clientSource) {} - std::shared_ptr source; + std::shared_ptr source; std::map tiles; int64_t sourceGeneration = 0; - bool clientDataSource; + bool clientTileSource; }; void updateTileSet(TileSet& tileSet, const ViewState& _view, const std::set& _visibleTiles); @@ -240,7 +240,7 @@ class TileManager { bool m_tileSetChanged = false; - /* Callback for DataSource: + /* Callback for TileSource: * Passes TileTask back with data for further processing by s */ TileTaskCb m_dataCallback; diff --git a/core/src/tile/tileTask.cpp b/core/src/tile/tileTask.cpp index 806bbd11d3..005d7f32bc 100644 --- a/core/src/tile/tileTask.cpp +++ b/core/src/tile/tileTask.cpp @@ -1,5 +1,5 @@ #include "tileTask.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "tile/tileBuilder.h" #include "scene/scene.h" #include "util/mapProjection.h" @@ -7,7 +7,7 @@ namespace Tangram { -TileTask::TileTask(TileID& _tileId, std::shared_ptr _source, int _subTask) : +TileTask::TileTask(TileID& _tileId, std::shared_ptr _source, int _subTask) : m_tileId(_tileId), m_subTaskId(_subTask), m_source(_source), diff --git a/core/src/tile/tileTask.h b/core/src/tile/tileTask.h index ba729649e2..5f27267086 100644 --- a/core/src/tile/tileTask.h +++ b/core/src/tile/tileTask.h @@ -11,7 +11,7 @@ namespace Tangram { class TileManager; class TileBuilder; -class DataSource; +class TileSource; class Tile; class MapProjection; struct TileData; @@ -21,7 +21,7 @@ class TileTask { public: - TileTask(TileID& _tileId, std::shared_ptr _source, int _subTask); + TileTask(TileID& _tileId, std::shared_ptr _source, int _subTask); // No copies TileTask(const TileTask& _other) = delete; @@ -39,7 +39,7 @@ class TileTask { std::shared_ptr& tile() { return m_tile; } - DataSource& source() { return *m_source; } + TileSource& source() { return *m_source; } int64_t sourceGeneration() const { return m_sourceGeneration; } TileID tileId() const { return m_tileId; } @@ -95,7 +95,7 @@ class TileTask { const int m_subTaskId; // Save shared reference to Datasource while building tile - std::shared_ptr m_source; + std::shared_ptr m_source; // Vector of tasks to download raster samplers std::vector> m_subTasks; @@ -114,13 +114,13 @@ class TileTask { class DownloadTileTask : public TileTask { public: - DownloadTileTask(TileID& _tileId, std::shared_ptr _source, int _subTask) + DownloadTileTask(TileID& _tileId, std::shared_ptr _source, int _subTask) : TileTask(_tileId, _source, _subTask) {} virtual bool hasData() const override { return rawTileData && !rawTileData->empty(); } - // Raw tile data that will be processed by DataSource. + // Raw tile data that will be processed by TileSource. std::shared_ptr> rawTileData; }; diff --git a/core/src/tile/tileWorker.cpp b/core/src/tile/tileWorker.cpp index 43df1819d0..e060eee5b4 100644 --- a/core/src/tile/tileWorker.cpp +++ b/core/src/tile/tileWorker.cpp @@ -1,7 +1,7 @@ #include "tileWorker.h" #include "platform.h" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "tile/tileID.h" #include "tile/tileTask.h" #include "tile/tileBuilder.h" diff --git a/linux/src/main.cpp b/linux/src/main.cpp index 50395b6dd0..9a7ce3b54a 100644 --- a/linux/src/main.cpp +++ b/linux/src/main.cpp @@ -85,7 +85,7 @@ void mouse_button_callback(GLFWwindow* window, int button, int action, int mods) map->setPositionEased(p.longitude, p.latitude, 1.f); logMsg("pick feature\n"); - map->clearDataSource(*data_source, true, true); + map->clearTileSource(*data_source, true, true); auto picks = map->pickFeaturesAt(x, y); std::string name; @@ -305,7 +305,7 @@ void init_main_window(bool recreate) { map->resize(width, height); data_source = std::make_shared("touch", ""); - map->addDataSource(data_source); + map->addTileSource(data_source); } diff --git a/tests/unit/tileManagerTests.cpp b/tests/unit/tileManagerTests.cpp index 0d5a84101b..9afae3332a 100644 --- a/tests/unit/tileManagerTests.cpp +++ b/tests/unit/tileManagerTests.cpp @@ -1,6 +1,6 @@ #include "catch.hpp" -#include "data/dataSource.h" +#include "data/tileSource.h" #include "tile/tileManager.h" #include "tile/tileWorker.h" #include "util/mapProjection.h" @@ -66,12 +66,12 @@ struct TestTileWorker : TileTaskQueue { } }; -struct TestDataSource : DataSource { +struct TestTileSource : TileSource { class Task : public TileTask { public: bool gotData = false; - Task(TileID& _tileId, std::shared_ptr _source, bool _subTask) + Task(TileID& _tileId, std::shared_ptr _source, bool _subTask) : TileTask(_tileId, _source, _subTask) {} bool hasData() const override { return gotData; } @@ -80,7 +80,7 @@ struct TestDataSource : DataSource { int tileTaskCount = 0; - TestDataSource() : DataSource("", nullptr) { + TestTileSource() : TileSource("", nullptr) { m_generateGeometry = true; } @@ -109,9 +109,9 @@ TEST_CASE( "Use proxy Tile - Dont remove proxy if it is now visible", "[TileMana TileManager tileManager(worker); ViewState viewState { &s_projection, true, glm::vec2(0), 1 }; - auto source = std::make_shared(); - std::vector> sources = { source }; - tileManager.setDataSources(sources); + auto source = std::make_shared(); + std::vector> sources = { source }; + tileManager.setTileSources(sources); /// Start loading tile 0/0/0 std::set visibleTiles_1 = { TileID{0,0,0} }; @@ -165,9 +165,9 @@ TEST_CASE( "Load visible Tile", "[TileManager][updateTileSets]" ) { TileManager tileManager(worker); ViewState viewState { &s_projection, true, glm::vec2(0), 1 }; - auto source = std::make_shared(); - std::vector> sources = { source }; - tileManager.setDataSources(sources); + auto source = std::make_shared(); + std::vector> sources = { source }; + tileManager.setTileSources(sources); std::set visibleTiles = { TileID{0,0,0} }; tileManager.updateTileSets(viewState, visibleTiles); @@ -191,9 +191,9 @@ TEST_CASE( "Use proxy Tile", "[TileManager][updateTileSets]" ) { TileManager tileManager(worker); ViewState viewState { &s_projection, true, glm::vec2(0), 1 }; - auto source = std::make_shared(); - std::vector> sources = { source }; - tileManager.setDataSources(sources); + auto source = std::make_shared(); + std::vector> sources = { source }; + tileManager.setTileSources(sources); std::set visibleTiles = { TileID{0,0,0} }; tileManager.updateTileSets(viewState, visibleTiles); @@ -230,9 +230,9 @@ TEST_CASE( "Use proxy Tile - circular proxies", "[TileManager][updateTileSets]" TileManager tileManager(worker); ViewState viewState { &s_projection, true, glm::vec2(0), 1 }; - auto source = std::make_shared(); - std::vector> sources = { source }; - tileManager.setDataSources(sources); + auto source = std::make_shared(); + std::vector> sources = { source }; + tileManager.setTileSources(sources); /// Start loading tile 0/0/0 std::set visibleTiles_1 = { TileID{0,0,0} };