From 20aabaf0532e727b27a54ab4ccb648f487cd1050 Mon Sep 17 00:00:00 2001 From: Anand Thakker Date: Fri, 16 Mar 2018 10:33:14 -0400 Subject: [TEMPORARY] Expose GeometryTileFeature in public API This is a temporary patch to unblock development downstream. The way we're actually planning to do this will be a bit more involved: https://github.com/mapbox/mapbox-gl-native/issues/11430 --- include/mbgl/util/geometry.hpp | 37 ++++++++++++++++++++++++++++++++++++ src/mbgl/tile/geometry_tile_data.hpp | 34 --------------------------------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/include/mbgl/util/geometry.hpp b/include/mbgl/util/geometry.hpp index a28c59a47d..7057c9bb3d 100644 --- a/include/mbgl/util/geometry.hpp +++ b/include/mbgl/util/geometry.hpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include namespace mbgl { @@ -37,6 +39,41 @@ using LinearRing = mapbox::geometry::linear_ring; template using Geometry = mapbox::geometry::geometry; + +// Normalized vector tile coordinates. +// Each geometry coordinate represents a point in a bidimensional space, +// varying from -V...0...+V, where V is the maximum extent applicable. +using GeometryCoordinate = Point; + +class GeometryCoordinates : public std::vector { +public: + using coordinate_type = int16_t; + + GeometryCoordinates() = default; + GeometryCoordinates(const std::vector& v) + : std::vector(v) {} + GeometryCoordinates(std::vector&& v) + : std::vector(std::move(v)) {} + + using std::vector::vector; +}; + +class GeometryCollection : public std::vector { +public: + using coordinate_type = int16_t; + using std::vector::vector; +}; + +class GeometryTileFeature { +public: + virtual ~GeometryTileFeature() = default; + virtual FeatureType getType() const = 0; + virtual optional getValue(const std::string& key) const = 0; + virtual PropertyMap getProperties() const { return PropertyMap(); } + virtual optional getID() const { return {}; } + virtual GeometryCollection getGeometries() const = 0; +}; + template Point convertPoint(const Point& p) { return Point(p.x, p.y); diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp index 449d8cab28..5974264fec 100644 --- a/src/mbgl/tile/geometry_tile_data.hpp +++ b/src/mbgl/tile/geometry_tile_data.hpp @@ -13,40 +13,6 @@ namespace mbgl { class CanonicalTileID; -// Normalized vector tile coordinates. -// Each geometry coordinate represents a point in a bidimensional space, -// varying from -V...0...+V, where V is the maximum extent applicable. -using GeometryCoordinate = Point; - -class GeometryCoordinates : public std::vector { -public: - using coordinate_type = int16_t; - - GeometryCoordinates() = default; - GeometryCoordinates(const std::vector& v) - : std::vector(v) {} - GeometryCoordinates(std::vector&& v) - : std::vector(std::move(v)) {} - - using std::vector::vector; -}; - -class GeometryCollection : public std::vector { -public: - using coordinate_type = int16_t; - using std::vector::vector; -}; - -class GeometryTileFeature { -public: - virtual ~GeometryTileFeature() = default; - virtual FeatureType getType() const = 0; - virtual optional getValue(const std::string& key) const = 0; - virtual PropertyMap getProperties() const { return PropertyMap(); } - virtual optional getID() const { return {}; } - virtual GeometryCollection getGeometries() const = 0; -}; - class GeometryTileLayer { public: virtual ~GeometryTileLayer() = default; -- cgit v1.2.1