summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-11-07 12:25:57 -0800
committerChris Loer <chris.loer@gmail.com>2017-11-07 12:25:57 -0800
commit99606e60c370fe7353cbf25be9a14a03152a9ef9 (patch)
tree9a4f3f425412f0ef4f470ca1751cd814b74ec7a1
parent0bbc80f5e81b6f1a2ed0bf12074bcde95a755f89 (diff)
downloadqtlocation-mapboxgl-99606e60c370fe7353cbf25be9a14a03152a9ef9.tar.gz
Remove GridIndex TODOs.
Move 'circle' type from `mapbox::geometry` to `mbgl::geometry` since it's not a GeoJSON type.
-rw-r--r--src/mbgl/util/grid_index.cpp1
-rw-r--r--src/mbgl/util/grid_index.hpp11
2 files changed, 5 insertions, 7 deletions
diff --git a/src/mbgl/util/grid_index.cpp b/src/mbgl/util/grid_index.cpp
index 61589f4284..88ec1f2b86 100644
--- a/src/mbgl/util/grid_index.cpp
+++ b/src/mbgl/util/grid_index.cpp
@@ -91,7 +91,6 @@ bool GridIndex<T>::hitTest(const BBox& queryBBox) const {
return hit;
}
-// TODO: templatize this on geometry type
template <class T>
bool GridIndex<T>::hitTest(const BCircle& queryBCircle) const {
bool hit = false;
diff --git a/src/mbgl/util/grid_index.hpp b/src/mbgl/util/grid_index.hpp
index 6e42a97bd7..6ef2966bee 100644
--- a/src/mbgl/util/grid_index.hpp
+++ b/src/mbgl/util/grid_index.hpp
@@ -8,14 +8,14 @@
#include <vector>
#include <functional>
-// TODO: Move into geometry.hpp project
-namespace mapbox {
+namespace mbgl {
+
namespace geometry {
template <typename T>
struct circle
{
- using point_type = point<T>;
+ using point_type = mapbox::geometry::point<T>;
constexpr circle(point_type const& center_, T const& radius_)
: center(center_), radius(radius_)
@@ -38,9 +38,7 @@ constexpr bool operator!=(circle<T> const& lhs, circle<T> const& rhs)
}
} // namespace geometry
-} // namespace mapbox
-namespace mbgl {
/*
GridIndex is a data structure for testing the intersection of
@@ -57,10 +55,11 @@ namespace mbgl {
template <class T>
class GridIndex {
public:
+
GridIndex(const float width_, const float height_, const int16_t cellSize_);
using BBox = mapbox::geometry::box<float>;
- using BCircle = mapbox::geometry::circle<float>;
+ using BCircle = geometry::circle<float>;
void insert(T&& t, const BBox&);
void insert(T&& t, const BCircle&);