From 57fcfabd77a834245e7ae62d4e11439d114eaf71 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Thu, 12 May 2016 11:51:11 -0700 Subject: [core] Make mapbox::geometry::envelope usable without explicit template arguments --- src/mbgl/geometry/feature_index.cpp | 4 ++-- src/mbgl/tile/geometry_tile.hpp | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/mbgl/geometry/feature_index.cpp b/src/mbgl/geometry/feature_index.cpp index fff2fbd075..d3d523af0a 100644 --- a/src/mbgl/geometry/feature_index.cpp +++ b/src/mbgl/geometry/feature_index.cpp @@ -24,7 +24,7 @@ void FeatureIndex::insert(const GeometryCollection& geometries, const std::string& bucketName) { for (const auto& ring : geometries) { grid.insert(IndexedSubfeature { index, sourceLayerName, bucketName, sortIndex++ }, - mapbox::geometry::envelope(ring)); + mapbox::geometry::envelope(ring)); } } @@ -59,7 +59,7 @@ void FeatureIndex::query( const GeometryTile& geometryTile, const Style& style) const { - mapbox::geometry::box box = mapbox::geometry::envelope(queryGeometry); + mapbox::geometry::box box = mapbox::geometry::envelope(queryGeometry); const float pixelsToTileUnits = util::EXTENT / tileSize / scale; const int16_t additionalRadius = std::min(util::EXTENT, std::ceil(style.getQueryRadius() * pixelsToTileUnits)); diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp index 20efc3c374..4db5d4dbeb 100644 --- a/src/mbgl/tile/geometry_tile.hpp +++ b/src/mbgl/tile/geometry_tile.hpp @@ -28,9 +28,19 @@ enum class FeatureType : uint8_t { // 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; -using GeometryCoordinates = std::vector; -using GeometryCollection = std::vector; +using GeometryCoordinate = Point; + +class GeometryCoordinates : public std::vector { +public: + using coordinate_type = int16_t; + using std::vector::vector; +}; + +class GeometryCollection : public std::vector { +public: + using coordinate_type = int16_t; + using std::vector::vector; +}; class GeometryTileFeature : private util::noncopyable { public: -- cgit v1.2.1