Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] rename VectorTileData => GeometryTileData
Browse files Browse the repository at this point in the history
  • Loading branch information
kkaefer committed Jun 6, 2016
1 parent 5b4c28b commit dce12cd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions src/mbgl/style/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <mbgl/tile/annotation_tile_source.hpp>
#include <mbgl/tile/raster_tile_source.hpp>

#include <mbgl/tile/vector_tile_data.hpp>
#include <mbgl/tile/geometry_tile_data.hpp>
#include <mbgl/tile/raster_tile_data.hpp>
#include <mbgl/style/parser.hpp>
#include <mbgl/gl/debugging.hpp>
Expand Down Expand Up @@ -222,8 +222,8 @@ std::unique_ptr<TileData> Source::createTile(const OverscaledTileID& overscaledT
return nullptr;
}

data = std::make_unique<VectorTileData>(overscaledTileID, std::move(monitor), id,
parameters.style, parameters.mode, callback);
data = std::make_unique<GeometryTileData>(overscaledTileID, std::move(monitor), id,
parameters.style, parameters.mode, callback);
}

return data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <mbgl/tile/vector_tile_data.hpp>
#include <mbgl/tile/geometry_tile_data.hpp>
#include <mbgl/tile/tile_source.hpp>
#include <mbgl/tile/geometry_tile.hpp>
#include <mbgl/style/layer_impl.hpp>
Expand All @@ -12,12 +12,12 @@

namespace mbgl {

VectorTileData::VectorTileData(const OverscaledTileID& id_,
std::unique_ptr<GeometryTileSource> tileSource_,
std::string sourceID,
style::Style& style_,
const MapMode mode_,
const std::function<void(std::exception_ptr)>& callback)
GeometryTileData::GeometryTileData(const OverscaledTileID& id_,
std::unique_ptr<GeometryTileSource> tileSource_,
std::string sourceID,
style::Style& style_,
const MapMode mode_,
const std::function<void(std::exception_ptr)>& callback)
: TileData(id_, std::move(tileSource_)),
style(style_),
worker(style_.workers),
Expand Down Expand Up @@ -93,11 +93,11 @@ VectorTileData::VectorTileData(const OverscaledTileID& id_,
});
}

VectorTileData::~VectorTileData() {
GeometryTileData::~GeometryTileData() {
cancel();
}

bool VectorTileData::parsePending(std::function<void(std::exception_ptr)> callback) {
bool GeometryTileData::parsePending(std::function<void(std::exception_ptr)> callback) {
if (workRequest) {
// There's already parsing or placement going on.
return false;
Expand Down Expand Up @@ -139,7 +139,7 @@ bool VectorTileData::parsePending(std::function<void(std::exception_ptr)> callba
return true;
}

Bucket* VectorTileData::getBucket(const style::Layer& layer) {
Bucket* GeometryTileData::getBucket(const style::Layer& layer) {
const auto it = buckets.find(layer.baseImpl->bucketName());
if (it == buckets.end()) {
return nullptr;
Expand All @@ -149,15 +149,15 @@ Bucket* VectorTileData::getBucket(const style::Layer& layer) {
return it->second.get();
}

void VectorTileData::redoPlacement(const PlacementConfig newConfig, const std::function<void()>& callback) {
void GeometryTileData::redoPlacement(const PlacementConfig newConfig, const std::function<void()>& callback) {
if (newConfig != placedConfig) {
targetConfig = newConfig;

redoPlacement(callback);
}
}

void VectorTileData::redoPlacement(const std::function<void()>& callback) {
void GeometryTileData::redoPlacement(const std::function<void()>& callback) {
// Don't start a new placement request when the current one hasn't completed yet, or when
// we are parsing buckets.
if (workRequest) return;
Expand Down Expand Up @@ -187,11 +187,11 @@ void VectorTileData::redoPlacement(const std::function<void()>& callback) {
});
}

void VectorTileData::queryRenderedFeatures(
std::unordered_map<std::string, std::vector<Feature>>& result,
const GeometryCoordinates& queryGeometry,
const TransformState& transformState,
const optional<std::vector<std::string>>& layerIDs) {
void GeometryTileData::queryRenderedFeatures(
std::unordered_map<std::string, std::vector<Feature>>& result,
const GeometryCoordinates& queryGeometry,
const TransformState& transformState,
const optional<std::vector<std::string>>& layerIDs) {

if (!featureIndex || !geometryTile) return;

Expand All @@ -206,7 +206,7 @@ void VectorTileData::queryRenderedFeatures(
style);
}

void VectorTileData::cancel() {
void GeometryTileData::cancel() {
obsolete = true;
tileRequest.reset();
workRequest.reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ namespace style {
class Style;
}

class VectorTileData : public TileData {
class GeometryTileData : public TileData {
public:
VectorTileData(const OverscaledTileID&,
GeometryTileData(const OverscaledTileID&,
std::unique_ptr<GeometryTileSource> tileSource,
std::string sourceID,
style::Style&,
const MapMode,
const std::function<void(std::exception_ptr)>& callback);

~VectorTileData();
~GeometryTileData();

Bucket* getBucket(const style::Layer&) override;

Expand Down

3 comments on commit dce12cd

@jfirebaugh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Makes sense, because VectorTileData is used with annotation, GeoJSON sources, and vector sources -- not just the latter. Renaming this to GeometryTileData aligns it with the convention for other code that these three source types share, like GeometryTile.

Is this easy to split out of #5143? Might make that PR a little easier to digest.

@kkaefer
Copy link
Member Author

@kkaefer kkaefer commented on dce12cd Jun 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could split it out, but it'll be quite some work to rebase the remainder.

@kkaefer
Copy link
Member Author

@kkaefer kkaefer commented on dce12cd Jun 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=> #5266

Please sign in to comment.