diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2016-04-05 16:27:37 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-29 12:00:24 -0700 |
commit | 61d14089e0dd742719328fd74c693bcae6274a4b (patch) | |
tree | e47265a472fe75c635a22815ddc4a0c3fa1dbf84 /src/mbgl/text/collision_tile.hpp | |
parent | 25442a77be75001665771097d8978b1191e403d9 (diff) | |
download | qtlocation-mapboxgl-61d14089e0dd742719328fd74c693bcae6274a4b.tar.gz |
[core] implement queryRenderedFeatures
Diffstat (limited to 'src/mbgl/text/collision_tile.hpp')
-rw-r--r-- | src/mbgl/text/collision_tile.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mbgl/text/collision_tile.hpp b/src/mbgl/text/collision_tile.hpp index eb5d4bc64c..4bc25ddcb7 100644 --- a/src/mbgl/text/collision_tile.hpp +++ b/src/mbgl/text/collision_tile.hpp @@ -33,12 +33,16 @@ typedef bgm::box<CollisionPoint> Box; typedef std::pair<Box, CollisionBox> CollisionTreeBox; typedef bgi::rtree<CollisionTreeBox, bgi::linear<16, 4>> Tree; +class IndexedSubfeature; + class CollisionTile { public: explicit CollisionTile(PlacementConfig); float placeFeature(const CollisionFeature& feature, const bool allowOverlap, const bool avoidEdges); - void insertFeature(CollisionFeature& feature, const float minPlacementScale); + void insertFeature(CollisionFeature& feature, const float minPlacementScale, const bool ignorePlacement); + + std::vector<IndexedSubfeature> queryRenderedSymbols(const float minX, const float minY, const float maxX, const float maxY, const float scale); const PlacementConfig config; @@ -50,9 +54,10 @@ private: float findPlacementScale(float minPlacementScale, const vec2<float>& anchor, const CollisionBox& box, const vec2<float>& blockingAnchor, const CollisionBox& blocking); - Box getTreeBox(const vec2<float>& anchor, const CollisionBox& box); + Box getTreeBox(const vec2<float>& anchor, const CollisionBox& box, const float scale = 1.0); Tree tree; + Tree ignoredTree; std::array<float, 4> rotationMatrix; std::array<float, 4> reverseRotationMatrix; std::array<CollisionBox, 4> edges; |